dbTalk Databases Forums  

undefined reference in libmysqlpp

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


Discuss undefined reference in libmysqlpp in the mailing.database.mysql-plusplus forum.



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

Default undefined reference in libmysqlpp - 01-15-2006 , 01:01 PM






Hi all,
I hope somebody can help pinpoint the error. I am new to mysql and mysql++=
..

This is the command:
g++32 -g -I../leda/incl -I. -I/usr/local/include/tre/=20
-I/usr/local/include/boost-1_33_1/ -I/usr/local/include/mysql++/
-I/usr/include/mysql/ -o tester tester.o $(OBJECTS) -L/usr/X11R6/lib
-L/usr/local/lib -L../leda -L/usr/lib/mysql/ -lX11 -lD3 -lW -lP -lG
-lL -lX11 -lm -lpthread -ltre -lnsl -l
tcmalloc -lboost_date_time-gcc -lxmlrpc_server_abyss++
-lxmlrpc_server++ -lxmlrpc_server_abyss -lxmlrpc_abyss -lxmlrpc_server
-lxmlrpc++ -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lmysqlclient
-lmysqlpp

And here is the error:

/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_initialize(void (*)(void*))'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
Quote:
::_Rep::_S_empty_rep_storage'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reserve_block(unsigne d int, unsigned
int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reclaim_block(char*, unsigned int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base*) '
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
Quote:
::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char
const&)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_get_thread_id()'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_destroy_thread_key(vo id*)'
collect2: ld returned 1 exit status
make: *** [tester] Error 1

Thanks
sandeep















I

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Sandeep Gupta
 
Posts: n/a

Default Re: undefined reference in libmysqlpp - 01-15-2006 , 01:48 PM






Hi Dave,

Removed all dependencies. Still the same error. I am running Fedora
Core 4 with gcc 3.2. Here is the transcript.

g++32 -g -I. -o tester tester.o -L/usr/lib/mysql/
-L/usr/local/lib/ -lpthread -lmysqlclient -lmysqlpp
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_initialize(void (*)(void*))'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
Quote:
::_Rep::_S_empty_rep_storage'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reserve_block(unsigne d int, unsigned
int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reclaim_block(char*, unsigned int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base*) '
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
Quote:
::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char
const&)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_get_thread_id()'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_destroy_thread_key(vo id*)'
collect2: ld returned 1 exit status
make: *** [tester] Error 1

On 1/15/06, Dave Brooks <dtb26 (AT) cornell (DOT) edu> wrote:
Quote:
Hey there...

Start by reducing your dependencies in your test, i.e. get rid of the boo=
st
libraries and anything else not directly related to mysql++; get that
working first.

Then, what OS and what version of g++ are you using? I've seen weird iss=
ue
crop up on SunOS that didn't appear on LINUX (especially concerning linka=
ge)

Dave
----------------------------------------
David Brooks
Academic Technology & Media Services
Cornell Information Technologies
Cornell University
(607)254-1551 [at Comp & Comm Cntr]
(607)254-6352 [at Carpenter Hall]
dtb26 (AT) cornell (DOT) edu
http://www.cit.cornell.edu/atc/


-----Original Message-----
From: Sandeep Gupta [mailto:gupta.sandeep (AT) gmail (DOT) com]
Sent: Sunday, January 15, 2006 2:01 PM
To: plusplus (AT) lists (DOT) mysql.com
Subject: undefined reference in libmysqlpp

Hi all,
I hope somebody can help pinpoint the error. I am new to
mysql and mysql++.

This is the command:
g++32 -g -I../leda/incl -I. -I/usr/local/include/tre/
-I/usr/local/include/boost-1_33_1/ -I/usr/local/include/mysql++/
-I/usr/include/mysql/ -o tester tester.o $(OBJECTS) -L/usr/X11R6/lib
-L/usr/local/lib -L../leda -L/usr/lib/mysql/ -lX11 -lD3 -lW -lP -lG
-lL -lX11 -lm -lpthread -ltre -lnsl -l
tcmalloc -lboost_date_time-gcc -lxmlrpc_server_abyss++
-lxmlrpc_server++ -lxmlrpc_server_abyss -lxmlrpc_abyss -lxmlrpc_server
-lxmlrpc++ -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lmysqlclient
-lmysqlpp

And here is the error:

/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_initialize(void (*)(void*))'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char
::_Rep::_S_empty_rep_storage'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reserve_block(unsigne d int, unsigned
int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reclaim_block(char*, unsigned int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base*) '
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char
::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char
const&)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_get_thread_id()'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_destroy_thread_key(vo id*)'
collect2: ld returned 1 exit status
make: *** [tester] Error 1

Thanks
sandeep















I

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsu...nell (DOT) edu



--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Sandeep Gupta
 
Posts: n/a

Default Re: undefined reference in libmysqlpp - 01-15-2006 , 02:41 PM



Yes i have two versions of gcc.
Setting CXX to g++32 and recompiling mysql++ solved the problem. I
wasn't aware that the CXX bypasses the shell variables (where i had
gcc point to gcc-32). Don't know who many days it would taken me
figure out if you didn't noticed.

Thanks
sandeep

On 1/15/06, Dave Brooks <dtb26 (AT) cornell (DOT) edu> wrote:
Quote:
Hi...

I noticed the '32' on your g++ command... Do you have more than one insta=
nce
of gcc installed?


I recently spent two days getting mysqlpp working on SunOS, and I've neve=
r
worked on fedora
So I can't offer direct help there, sorry.

This is one of my make commands, you'll notice a couple oddities with it,
which may prove helpful:

/usr/local/bin/g++ -g -Wall -Wno-deprecated -R/usr/local/lib -oonset.cgi
onset.cpp onsetdb.o -I/usr/local/include -L/usr/local/lib
-I/usr/local/mysql-4.1.15/include/mysql/ -L/usr/local/mysql-4.1.15/lib/my=
sql
/usr/local/mysql-4.1.15/lib/mysql/libmysqlclient.a -lmysqlclient
-I/usr/local/include/mysql++ -lmysqlpp -lsocket -lposix4 -lcrypt -lgen
-lsocket -lnsl -lm -lz -I/usr/local/include/sallow32
-L/usr/local/lib/sallow32 -lsallow32


I had more than one g++ installed, so I defined CXX to point to the one I
needed which is version 4.0.1

I also couldn't get mysqlpp to compile against an older MySQL client, so=
I
installed v4.1.15

Notice my -L to the client libs, I HAD to include both lines:
"-L/usr/local/mysql-4.1.15/lib/mysql
/usr/local/mysql-4.1.15/lib/mysql/libmysqlclient.a"
It refused to compile without both the path to the lib as well as an
absolute to the *.a, I've never figured out why, but I got a lot of simil=
ar
linkage errors that your seeing until I did this.

The last thing I ran into which was a royal pain, was that I had to inclu=
de
linkage to all the libs that mysqlpp used:
-lmysqlpp -lsocket -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lz

What led me to this solution was looking at the makefiles that the mysqlp=
p
examples used, and I noticed they were also linking directly to std libs
rather than to just the mysqlpp lib as you would expect.

These changes got me up and going finally.

If nothing here works for you, try getting one of their examples working,=
if
it compiles you then have something to look at for differences.

Hope something here helped you out

-Dave
----------------------------------------
David Brooks
Academic Technology & Media Services
Cornell Information Technologies
Cornell University
(607)254-1551 [at Comp & Comm Cntr]
(607)254-6352 [at Carpenter Hall]
dtb26 (AT) cornell (DOT) edu
http://www.cit.cornell.edu/atc/

-----Original Message-----
From: Sandeep Gupta [mailto:gupta.sandeep (AT) gmail (DOT) com]
Sent: Sunday, January 15, 2006 2:49 PM
To: dtb26 (AT) cornell (DOT) edu
Cc: plusplus (AT) lists (DOT) mysql.com
Subject: Re: undefined reference in libmysqlpp

Hi Dave,

Removed all dependencies. Still the same error. I am running Fedora
Core 4 with gcc 3.2. Here is the transcript.

g++32 -g -I. -o tester tester.o -L/usr/lib/mysql/
-L/usr/local/lib/ -lpthread -lmysqlclient -lmysqlpp
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_initialize(void (*)(void*))'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char
::_Rep::_S_empty_rep_storage'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reserve_block(unsigne d int, unsigned
int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reclaim_block(char*, unsigned int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base*) '
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char
::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char
const&)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_get_thread_id()'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_destroy_thread_key(vo id*)'
collect2: ld returned 1 exit status
make: *** [tester] Error 1

On 1/15/06, Dave Brooks <dtb26 (AT) cornell (DOT) edu> wrote:

Hey there...

Start by reducing your dependencies in your test, i.e. get
rid of the boost
libraries and anything else not directly related to
mysql++; get that
working first.

Then, what OS and what version of g++ are you using? I've
seen weird issue
crop up on SunOS that didn't appear on LINUX (especially
concerning linkage)

Dave
----------------------------------------
David Brooks
Academic Technology & Media Services
Cornell Information Technologies
Cornell University
(607)254-1551 [at Comp & Comm Cntr]
(607)254-6352 [at Carpenter Hall]
dtb26 (AT) cornell (DOT) edu
http://www.cit.cornell.edu/atc/


-----Original Message-----
From: Sandeep Gupta [mailto:gupta.sandeep (AT) gmail (DOT) com]
Sent: Sunday, January 15, 2006 2:01 PM
To: plusplus (AT) lists (DOT) mysql.com
Subject: undefined reference in libmysqlpp

Hi all,
I hope somebody can help pinpoint the error. I am new to
mysql and mysql++.

This is the command:
g++32 -g -I../leda/incl -I. -I/usr/local/include/tre/
-I/usr/local/include/boost-1_33_1/ -I/usr/local/include/mysql++/
-I/usr/include/mysql/ -o tester tester.o $(OBJECTS)
-L/usr/X11R6/lib
-L/usr/local/lib -L../leda -L/usr/lib/mysql/ -lX11 -lD3
-lW -lP -lG
-lL -lX11 -lm -lpthread -ltre -lnsl -l
tcmalloc -lboost_date_time-gcc -lxmlrpc_server_abyss++
-lxmlrpc_server++ -lxmlrpc_server_abyss -lxmlrpc_abyss
-lxmlrpc_server
-lxmlrpc++ -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok
-lmysqlclient
-lmysqlpp

And here is the error:

/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_initialize(void (*)(void*))'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>,
std::allocator<char
::_Rep::_S_empty_rep_storage'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reserve_block(unsigne d int, unsigned
int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_insert_and_rebalance(bool,
std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_reclaim_block(char*, unsigned int)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base*) '
/usr/local/lib/libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>,
std::allocator<char
::_Rep::_S_create(unsigned int, unsigned int,
std::allocator<char
const&)'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_get_thread_id()'
/usr/local/lib/libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_destroy_thread_key(vo id*)'
collect2: ld returned 1 exit status
make: *** [tester] Error 1

Thanks
sandeep















I

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsu...nell (DOT) edu




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsu...nell (DOT) edu



--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Chris Frey
 
Posts: n/a

Default Re: undefined reference in libmysqlpp - 01-15-2006 , 02:43 PM



On Sun, Jan 15, 2006 at 11:48:40AM -0800, Sandeep Gupta wrote:
Quote:
Hi Dave,

Removed all dependencies. Still the same error. I am running Fedora
Core 4 with gcc 3.2. Here is the transcript.

g++32 -g -I. -o tester tester.o -L/usr/lib/mysql/
-L/usr/local/lib/ -lpthread -lmysqlclient -lmysqlpp
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/local/lib//libmysqlpp.so: undefined reference to
`__gnu_cxx::__pool<true>::_M_initialize(void (*)(void*))'
/usr/local/lib//libmysqlpp.so: undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char
Did you compile your own version of mysql++ or use an RPM?

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



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.