dbTalk Databases Forums  

Cannot load ... undefined symbol - linker error?

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Cannot load ... undefined symbol - linker error? in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SheriMarie
 
Posts: n/a

Default Cannot load ... undefined symbol - linker error? - 10-12-2006 , 01:08 PM






Hello all,

I am trying to add mysql++ to an already existing apache module. I
added the necessary includes in the makefile
(-I/usr/local/include/mysql++ -I/usr/include/mysql
-L/usr/local/include/mysql++ -lmysqlpp) and also added a "#include
"mysql++.h"" to the file that is using the mysql++.h code. It compiles
fine, but when I try to run it, I get this runtime error:

$ run
cannot load /usr/lib/libmymodule.so into server: /usr/lib/mymodule.so:
undefined symbol:
_ZN7mysqlpp10Connection7connectEPKcS2_S2_S2_jcjS2_ j

This is obviously a linking problem. The weird thing is, that I can
declare a Connection variable like so and it does not crash at runtime:

mysql::Connection& con;

But when I try to call a function from the Connection class, like so:

con.connect( ... );\

I get the "cannot load" error as stated above..

I believe it has something to do with how I set up my Makefile.am. But
I am new at Makefiles and I don't see my error.

Help??


Reply With Quote
  #2  
Old   
SheriMarie
 
Posts: n/a

Default Re: Cannot load ... undefined symbol - linker error? - 10-12-2006 , 03:28 PM






Hi again..

I figured out the problem. My module was not seeing the mysqlpp
library because I had them under the INCLUDES in my Makefile.am file.
I added it under the new line libconfig_la_LDFLAGS= [libs] and all was
right with the world..

well at least in my program

I told you I was new to makefiles


SheriMarie wrote:
Quote:
Hello all,

I am trying to add mysql++ to an already existing apache module. I
added the necessary includes in the makefile
(-I/usr/local/include/mysql++ -I/usr/include/mysql
-L/usr/local/include/mysql++ -lmysqlpp) and also added a "#include
"mysql++.h"" to the file that is using the mysql++.h code. It compiles
fine, but when I try to run it, I get this runtime error:

$ run
cannot load /usr/lib/libmymodule.so into server: /usr/lib/mymodule.so:
undefined symbol:
_ZN7mysqlpp10Connection7connectEPKcS2_S2_S2_jcjS2_ j

This is obviously a linking problem. The weird thing is, that I can
declare a Connection variable like so and it does not crash at runtime:

mysql::Connection& con;

But when I try to call a function from the Connection class, like so:

con.connect( ... );\

I get the "cannot load" error as stated above..

I believe it has something to do with how I set up my Makefile.am. But
I am new at Makefiles and I don't see my error.

Help??


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.