This is not how the -l
option works.
You must specify the library name, which is not the file path, and specify its directory as library search path:
gcc ... -L/home/sysadm/ -lsqlite3
문제
I've compilled sqlite from sources (version 3.7.16.1) under CentOS 5.9 32bit. It compilled successfully but i'm unable to link against it or use it anyhow.
I'm compilling like this:
CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_UNLOCK_NOTIFY -lstdc++" ./configure --enable-shared --enable-static=no
And when i try to link against it, i'm getting:
[sysadm@depon-460sf2 ~]$ gcc main.c -l /home/sysadm/libsqlite3.so.0.8.6
/usr/bin/ld: cannot find -l/home/sysadm/libsqlite3.so.0.8.6
I call gcc under the same system sqlite was built under. ldd seems fine:
[sysadm@depon-460sf2 ~]$ ldd /home/sysadm/libsqlite3.so.0.8.6
linux-gate.so.1 => (0x00f2f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x002d4000)
libdl.so.2 => /lib/libdl.so.2 (0x00110000)
libpthread.so.0 => /lib/libpthread.so.0 (0x002ac000)
libc.so.6 => /lib/libc.so.6 (0x00115000)
libm.so.6 => /lib/libm.so.6 (0x004d2000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x008d9000)
/lib/ld-linux.so.2 (0x0055e000)
What am i doing wrong?
해결책
This is not how the -l
option works.
You must specify the library name, which is not the file path, and specify its directory as library search path:
gcc ... -L/home/sysadm/ -lsqlite3