Hi All, I am compiling a program with gcc on Fedora 8 machine (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)). It requires libsqlite3. I compile it as follows: gcc -Wall -g showbs4.c -o showbs4 `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` -L/usr/lib/ -lsqlite3.so ls -l /usr/lib/libsqlite3.so* shows: lrwxrwxrwx 1 root root 19 2008-12-05 13:41 /usr/lib/libsqlite3.so -> libsqlite3.so.0.8.6 lrwxrwxrwx 1 root root 19 2007-11-02 19:49 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.0.8.6 -rwxr-xr-x 1 root root 435812 2007-09-28 18:24 /usr/lib/libsqlite3.so.0.8.6 LD_LIBRARY_PATH is set to : LD_LIBRARY_PATH=/usr/lib gcc is still not able to find libsqlite3. How do I tell gcc to include the libsqlite3 ?:thinking: This might be trivial. But I have not been able to figure as to what else I can do. :embarasse Thanks, Midhun
-lXYZ is a linker shortcut; it tells the linker to look for libXYZ.a, e.g. to link with libm.a you just specify -lm. So if you specify -lsqlite3.so the linker dutifully adds lib and .a and goes off looking for libsqlite3.so.a. If you want it to link with sqlite3.so, just leave the -l prefix off.