![]() |
|
#1
|
|||
|
|||
linker errors while compiling sqlite3 with a programI made this program:
CPP / C++ / C Code:
Code:
It's probally an progamming mistake I made, but I can't figure out where I made it. Any help is much appreciated. Ryver |
|
#2
|
||||
|
||||
Re: linker errors while compiling sqlite3 with a programIt looks like you need to link to the library.
From the command line it will look something like -lsqlite or if you are using an IDE you will need to add them to your list of libraries to link to. Mark EDIT: This link may help as it directs to a few examples here. http://www.gidforums.com/showthread.php?p=47766 __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#3
|
|||
|
|||
Re: linker errors while compiling sqlite3 with a programThe thing is I'm not using a libary, I'm using the sources (.c and .h) of sqlite3.
But is it a better idea to to turn sqlite3 into a libary? could that work with c? btw I'm using the dev-c++ IDE. |
|
#4
|
||||
|
||||
Re: linker errors while compiling sqlite3 with a programSo where are the functions defined in the source? Are they in both the CPP and H files? If not, you're missing a library. If so, be sure to include the proper header and build with the proper source file.
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#5
|
||||
|
||||
Re: linker errors while compiling sqlite3 with a programI see you don't call sqlite3GetToken or sqlite3MPrintf in your file, so these functions must be called from within the other project (sqlite3). You only call the wrapper functions - that is what I suspect sqlite3_open and the others to be.
Therefore, either the sqlite3 project uses a library you didn't include, or - more likely - the 2 files you imported aren't the only files in that project. Check for additional includes the sqlite3 header and source file may have. If they aren't too long and you feel like it, you could post those 2 files here as well. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#6
|
|||
|
|||
Re: linker errors while compiling sqlite3 with a programQuote:
If you haven't built the sqlite library, build it first. You don't want to "use" any sqlite "c" files. You only want to include sqlite3.h. Take a look at the C example located at: www.sqlite.org You will then link your program against the sqlite library. :davis: |
Recent GIDBlog
I?m Home by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem compiling a program, my first vector. | george89 | C++ Forum | 2 | 26-Jun-2006 22:10 |
| In Need of Some Serious Help...compiling errors [C++] | needcishelp | C++ Forum | 25 | 21-Dec-2005 02:26 |
| Compiling/Linking | roostercogburn | C Programming Language | 5 | 08-Nov-2005 15:32 |
| Compiling Errors | ToddSAFM | C++ Forum | 22 | 18-Dec-2004 12:42 |
| compiling a program within another (C++) | Siphiro | C++ Forum | 5 | 06-Feb-2004 16:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The