The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using funcion in a shared library yhacks High Level Programming 1 05-23-2008 04:03 AM
Shared memory in shared library DreamWarrior High Level Programming 12 05-30-2007 01:33 PM
shared library areef4u UNIX for Advanced & Expert Users 1 07-31-2006 11:14 PM
Creation of Shared library sarangb SCO 0 06-17-2005 04:51 AM
Shared Library rajashekaran High Level Programming 2 08-03-2002 10:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 12-28-2007
Registered User
 

Join Date: Dec 2007
Posts: 260
are you using sqlite3_xxxx() or sqlite_xxxx() calls? It looks like your not using the V3 API.

ie:

sqlite3_open()

or

sqlite_open()
Reply With Quote
Forum Sponsor
  #9  
Old 12-28-2007
JCR JCR is offline
Registered User
 

Join Date: Jan 2007
Posts: 29
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).
Reply With Quote
  #10  
Old 12-28-2007
Registered User
 

Join Date: Dec 2007
Posts: 260
try this

Code:
export LD_LIBRARY_PATH=/usr/local/lib
ldd ./app
and then execute you program
Reply With Quote
  #11  
Old 12-28-2007
JCR JCR is offline
Registered User
 

Join Date: Jan 2007
Posts: 29
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.
Reply With Quote
  #12  
Old 12-28-2007
Registered User
 

Join Date: Dec 2007
Posts: 260
add
Code:
-Wl,-R/usr/local/lib
to your Makefile and rebuild.

then rerun as a cgi
Reply With Quote
  #13  
Old 12-28-2007
JCR JCR is offline
Registered User
 

Join Date: Jan 2007
Posts: 29
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0