![]() |
|
#1
|
|||
|
|||
Compiling C & C++ files?If I am using SQLite (which is written in C) and want to amalgamate it into a C++ application can I do this using a C/C++ compiler (meaning a IDE/compiler which compiles both languages)?
AND Is this what a wrapper class is for? To link the C (SQLite sourcefiles) with those application source code files written in C++. Thanks dominover |
|||
|
#2
|
|||
|
|||
Re: Compiling C & C++ files?Quote:
Wrapper classes can add functionality, and may be worth evaluating. However... The header file used for compiling applications using sqlite3 functions already has the "magic" to make it possible to call the sqlite3 functions from a C++ program. CPP / C++ / C Code:
Regards, Dave Footnote: It is, in general, very straightforward to put stuff in header files so that previously-compiled C library functions can be linked into C++ programs. There are only a couple of minor (and quite obscure) 'issues" that could possibly create problems. These are non-issues with sqlite3. Going the other way (trying to write programs that call C++ library functions from C programs) is, in general, not very practical. __________________
Sometimes I just can't help myself... |
|
#3
|
|||
|
|||
Re: Compiling C & C++ files?Quote:
CPP / C++ / C Code:
Here's a run, including preparation of the data base from the command line, as indicated in the comments of the program: Code:
Regards, Dave Footnote: This program is simply a C program transliterated to use C++ I/O, and uses none of the extra power of C++. It is only an example, but, I hope, it illustrates the point that you can use the pre-compiled SQLite3 C language library in a C++ program. __________________
Sometimes I just can't help myself... Last edited by davekw7x : 23-Feb-2012 at 10:49.
|
Recent GIDBlog
Planned Network Maintenance on 2013-05-29 by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Apache newbie serving files outside documentroot | Davidpcs | Apache Web Server Forum | 1 | 09-May-2011 16:56 |
| FLTK Not installing | AJk101 | FLTK Forum | 1 | 05-Feb-2011 14:43 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 06:19 |
| Tutorial: Adding Music to your Site, WAV, MP3, Flash? | abacomedia | Web Design Forum | 1 | 20-May-2004 15:10 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 02:26 |
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The