For some reason I haven't seen the response to my previous post, but (obviously) I've seen this one.
Didier Spaier wrote: > May I suggest you don't use precompiled packages when they are not "official" > (i.e., included in Slackware distribution) ones, but make your own packages. > Yuu can find Slackbuilds for sqlite-3.5.7 on slackbuild.org and salcky.eu > websites for that purpose. > > There is a typo in your command: > bash-3.1# gcc -llibsqlite3.so CreaDB.c -o CreaDB > > should read : > bash-3.1# gcc -libsqlite3.so CreaDB.c -o CreaDB Should really read 'gcc -lsqlite3 CreaDB.c -o CreaDB When linking to a library, you typically strip 'lib' and '.so' (or '.a' if its a static library) from the name. If this was Windows, you'd strip '.dll' from the name. If you want to include the entire contents of a static (.a) library in your app, you can simply include it in your link line with the other .o's. BTW, I didn't actually try out from end to end what I suggested in my previous post, so my apologies if what I suggested didn't work. > > Don't forget to add : > #include <string.h> > as menionned by Glenn McAllister > > And may i suggest you compile your program as a standard user, not as root. I second this. Doing things as root is a real great way to hose your system if you make a mistake. > > HTH, > > Didier > > Le Sunday 06 April 2008 00:10:30 [EMAIL PROTECTED], vous avez écrit : >> What did you download from >> http://www.sqlite.org/download.html ? >> sqlite-3.5.7.so.gz, or >> sqlite-amalgamation-3.5.7.tar.gz? > > I've installed sqlite-3.5.7 precompiled package on my slackware system. Below > there is results of searches: > > bash-3.1# find / -name sqlite3.c > > bash-3.1# > > bash-3.1# find / -name sqlite3.h > /usr/include/seamonkey-1.1.2/sqlite3/sqlite3.h > /usr/include/sqlite3.h > bash-3.1# find / -name libsqlite3.so > /usr/lib/libsqlite3.so > bash-3.1# OK, so you've got SQLite 3 installed. This is obviously good enough to get goingn. > > I try to compile: > > bash-3.1# gcc -llibsqlite3.so CreaDB.c -o CreaDB > CreaDB.c: In function 'main': > CreaDB.c:21: warning: incompatible implicit declaration of built-in function > 'strlen' > CreaDB.c:5: warning: return type of 'main' is not 'int' > CreaDB.c:41:3: warning: no newline at end of file > /usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld: > cannot find -llibsqlite3.so > collect2: ld returned 1 exit status > bash-3.1# ls > CreaDB.c Desktop GNUstep loadlin16c.txt So the ld (the linker which gcc is calling on your behalf) is telling you it couldn't find the sqlite3 library. As I mentioned previously, you need to specify -lsqlite to indicate your application requires the libsqlite3.so library at run-time. -- Glenn McAllister <[EMAIL PROTECTED]> +1 416 348 1594 SOMA Networks, Inc. http://www.somanetworks.com/ +1 416 977 1414 Asking a writer what he thinks about criticism is like asking a lamppost what it feels about dogs. - John Osborne _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

