On a Centos 5.0 box, I have two versions of a library (sqlite):
(1) in /usr/lib that was installed using yum (maybe from php but I am not really sure)
(2) in /usr/local/lib that I installed myself by compiling from the source code.
Thanks for the answer. I tried
$(TARGET_APP) : main.o
$(CPP) -L $(FASTCGI_LIB) /usr/local/lib/ -lsqlite3 -o $(TARGET_APP) main.o
but compilation failed with the following message:
/usr/local/lib/: file not recognized: Is a directory
collect2: ld returned 1 exit status
make: *** [lock.vrv] Error 1
$(TARGET_APP) : main.o
$(CPP) $(FASTCGI_LIB) -L /usr/local/lib/ -lsqlite3 -o $(TARGET_APP) main.o
doe compile indeed ( I just took off the -L before $(FASTCGI_LIB) but I am back to my previous problem since the final executable returns:
symbol lookup error: ./app: undefined symbol: sqlite3_open_v2
Since the program compiles, the sqlite_open_v2 is found in both the header and the shared library but for some reason, at run-time, it fails.
I am trying to use sqlite3_open_v2, which I believe is in sqlite 3.5.4 (the one I am trying to link to in /usr/local/lib), but is not member of sqlite 3.3.6 (the one at /usr/lib).
ldd ./app returns
linux-gate.so.1 => (0xffffe000)
libfcgi++.so.0 => /usr/local/lib/libfcgi++.so.0 (0x40001000)
libsqlite3.so.0 => /usr/local/lib/libsqlite3.so.0 (0x40006000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x46dfb000)
libm.so.6 => /lib/libm.so.6 (0x46dab000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x46ded000)
libc.so.6 => /lib/libc.so.6 (0x46c69000)
libfcgi.so.0 => /usr/local/lib/libfcgi.so.0 (0x40077000)
libnsl.so.1 => /lib/libnsl.so.1 (0x46543000)
libpthread.so.0 => /lib/libpthread.so.0 (0x46dd4000)
/lib/ld-linux.so.2 (0x4629a000)
./app does not crash as before
but when I run it from the webrowser (this is a fastcgi app) the apache error_logs contains the following line:
[Fri Dec 28 14:14:25 2007] [error] [client 99.xxxx] ...cgi-bin/app: symbol lookup error: ...cgi-bin/app: undefined symbol: sqlite3_open_v2
[Fri Dec 28 14:14:25 2007] [error] [client 99.xxxx] Premature end of script headers: app.
Hello,
When I use the sqlite3_open function, there is no issue but with sqlite3_open_v2, compilation completes fine but at run-time as a cgi I am getting:
[warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Fri Dec 28 22:58:46 2007] [error] [client 99xxx] Premature end of script headers: app
At least it's working and I will explore the v2-related issues a bit later.
Thank you for your help