dbTalk Databases Forums  

Link errors with resetdb example program

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


Discuss Link errors with resetdb example program in the mailing.database.mysql-plusplus forum.



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

Default Link errors with resetdb example program - 06-08-2005 , 02:41 PM






--=_alternative 006A3EB58525701A_=
Content-Type: text/plain; charset="US-ASCII"

Hi there,

I was able to compile MySQL++ just fine after hacking Makefile to remove
compiling examples, but see below for the error I got. I have the
following link problems when trying the examples:

[dsmith@saquri01 examples]$ make -f Makefile.simple clean && make -f
Makefile.simple
rm -f *.o resetdb simple1 custom1 custom2 custom3 custom4 fieldinf1 dbinfo
cgi_image load_file updel
g++ -I/opt/mysql++/mysql++-1.7.40/include -I/usr/local/mysql/include/mysql
-O2 -c resetdb.cpp
g++ -I/opt/mysql++/mysql++-1.7.40/include -I/usr/local/mysql/include/mysql
-O2 -c util.cpp
g++ resetdb.o util.o -o resetdb -lmysqlpp -lmysqlclient
-L/opt/mysql++/mysql++-1.7.40/lib -L/usr/local/mysql/lib/mysql
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp5QueryE0_Sd +0x18): undefined
reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp5QueryE0_Sd +0x28): undefined
reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp8SQLQueryE0 _Sd+0x18): undefined
reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp8SQLQueryE0 _Sd+0x28): undefined
reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
collect2: ld returned 1 exit status
make: *** [resetdb] Error 1

I added -lstdc++ to Makefile.simple just in case but it doesn't help. I'm
not sure why the destructor for basic_iostream is not found. Has anyone
run into this before? I read the manual, the FAQ, searched the mailing
list, and did a google search but couldn't find anything relevant.

TIA,
Dale Smith, Ph.D.
dalesmith (AT) dtcc (DOT) com
DTCC Risk Management
Quantitative Group
212-855-7641

--=_alternative 006A3EB58525701A_=--


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

Default Re: Link errors with resetdb example program - 06-08-2005 , 03:23 PM






On Wed, Jun 08, 2005 at 03:20:27PM -0400, Dale Smith wrote:
Quote:
Hi there,

I was able to compile MySQL++ just fine after hacking Makefile to remove
compiling examples, but see below for the error I got. I have the
following link problems when trying the examples:
Without the special hack, do you get the same errors when compiling
the examples normally?

Can you compile and run a simple C++ example like:

#include <iostream>
int main() { std::cout << "hello world" << std::endl; }

Just wondering if there is something more seriously wrong with your
system in general.

And what kind of system is it? :-) Linux? Version? Version of mysql++?
Version of mysql?

- 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
  #3  
Old   
Dale Smith
 
Posts: n/a

Default Re: Link errors with resetdb example program - 06-08-2005 , 03:32 PM



--=_alternative 0070C5A18525701A_=
Content-Type: text/plain; charset="US-ASCII"

Thanks for the response.

I can compile not only simple C++ programs, but other, more complicated
ones. I have also successfully compiled and used other freeware libraries
in the past few weeks. That's why I was so surprised about this kind of
problem.

Without the special hack, I could not get MySQL++ to compile - the library
code compiled and linked but the examples wouldn't compile. I thought
there was some sort of strange problem with them and decided to get the
library built. I guess this indicated a problem with the library code
itself, so I should have posted Monday.

I have version 1.7.40 of MySQL++, and version 4.1.10a of MySQL. uname -a
reports

Linux xxxx 2.4.21-sgi305r1 #1 SMP Mon Mar 28 11:22:59 PST 2005
ia64 ia64 ia64 GNU/Linux

This is a 2.4 kernel with SMP back-ports from 2.6 that SGI created for
their Altix servers. The server itself has 32 Itanium 64 bit processors.

Dale Smith, Ph.D.
dalesmith (AT) dtcc (DOT) com
DTCC Risk Management
Quantitative Group
212-855-7641




Chris Frey <cdfrey (AT) netdirect (DOT) ca>
06/08/2005 04:22 PM

To
plusplus (AT) lists (DOT) mysql.com
cc

Subject
Re: Link errors with resetdb example program






On Wed, Jun 08, 2005 at 03:20:27PM -0400, Dale Smith wrote:
Quote:
Hi there,

I was able to compile MySQL++ just fine after hacking Makefile to remove

compiling examples, but see below for the error I got. I have the
following link problems when trying the examples:
Without the special hack, do you get the same errors when compiling
the examples normally?

Can you compile and run a simple C++ example like:

#include <iostream>
int main() { std::cout << "hello world" << std::endl; }

Just wondering if there is something more seriously wrong with your
system in general.

And what kind of system is it? :-) Linux? Version? Version of mysql++?
Version of mysql?

- Chris


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



--=_alternative 0070C5A18525701A_=--


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

Default Re: Link errors with resetdb example program - 06-08-2005 , 03:44 PM



On Wed, Jun 08, 2005 at 04:31:45PM -0400, Dale Smith wrote:
Quote:
Thanks for the response.

I can compile not only simple C++ programs, but other, more complicated
ones. I have also successfully compiled and used other freeware libraries
in the past few weeks. That's why I was so surprised about this kind of
problem.

Without the special hack, I could not get MySQL++ to compile - the library
code compiled and linked but the examples wouldn't compile. I thought
Could you post the errors from the straight compile? I'm assuming they
are the same, but maybe there will be a clue. More info the better.

What compiler are you using? Is it possible to upgrade, or install a
side compiler for testing? I run gcc-4.0.0 in a separate user account
and home directory, since my system compiler is 3.3.4. This lets me
play easily with different compiler versions... and it may help rule out
a compiler problem in your case.

If you're interested in my script setup for this, I'll be happy to post
them.

- 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
  #5  
Old   
Dale Smith
 
Posts: n/a

Default Re: Link errors with resetdb example program - 06-08-2005 , 04:01 PM



--=_alternative 00737AE78525701A_=
Content-Type: text/plain; charset="US-ASCII"

Thanks again for responding.

We are using gcc 3.4.3. I copied the tarball I downloaded and re-made in a
separate directory. Configure picked up the LDFLAGS and CPPFLAGS
variables, where I had put some boost directories. I removed them, removed
the build directory, and untarred so I can rebuild cleanly. Below is some
of the make output.

I will see what I can do with another compiler, but it may take some time
to set that up. I do have the Intel 8.0 compiler, so I may try it tomorrow
morning.

creating libmysqlpp.la
(cd .libs && rm -f libmysqlpp.la && ln -s ../libmysqlpp.la libmysqlpp.la)
make[2]: Leaving directory `/tmp/dsmith/mysql++-1.7.40/lib'
Making all in examples
make[2]: Entering directory `/tmp/dsmith/mysql++-1.7.40/examples'
source='resetdb.cpp' object='resetdb.o' libtool=no \
depfile='.deps/resetdb.Po' tmpdepfile='.deps/resetdb.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I/usr/local/mysql/include/mysql
-g -O2 -c -o resetdb.o `test -f 'resetdb.cpp' || echo './'`resetdb.cpp
source='util.cpp' object='util.o' libtool=no \
depfile='.deps/util.Po' tmpdepfile='.deps/util.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I/usr/local/mysql/include/mysql
-g -O2 -c -o util.o `test -f 'util.cpp' || echo './'`util.cpp
/bin/sh ../libtool --mode=link g++ -g -O2 -L/usr/local/mysql/lib/mysql
-o resetdb resetdb.o util.o ../lib/libmysqlpp.la -lz -lmysqlclient
mkdir .libs
g++ -g -O2 -o .libs/resetdb resetdb.o util.o -L/usr/local/mysql/lib/mysql
.../lib/.libs/libmysqlpp.so
/opt/mysql/4.1.10a-src/lib/mysql/libmysqlclient.so -lcrypt -lnsl -lm -lz
-Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/opt/mysql/4.1.10a-src/lib/mysql
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp5QueryE0_Sd +0x18):/opt/gcc/3.4.3/bin/../lib/gcc/ia64-unknown-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:258:
undefined reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp5QueryE0_Sd +0x28):/opt/gcc/3.4.3/bin/../lib/gcc/ia64-unknown-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:258:
undefined reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp8SQLQueryE0 _Sd+0x18):/opt/gcc/3.4.3/bin/../lib/gcc/ia64-unknown-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:258:
undefined reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
resetdb.o(.gnu.linkonce.r._ZTCN7mysqlpp8SQLQueryE0 _Sd+0x28):/opt/gcc/3.4.3/bin/../lib/gcc/ia64-unknown-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:258:
undefined reference to `std::basic_iostream<char, std::char_traits<char>
Quote:
::~basic_iostream()'
collect2: ld returned 1 exit status

Dale Smith, Ph.D.
dalesmith (AT) dtcc (DOT) com
DTCC Risk Management
Quantitative Group
212-855-7641




Chris Frey <cdfrey (AT) netdirect (DOT) ca>
06/08/2005 04:44 PM

To
plusplus (AT) lists (DOT) mysql.com
cc

Subject
Re: Link errors with resetdb example program






On Wed, Jun 08, 2005 at 04:31:45PM -0400, Dale Smith wrote:
Quote:
Thanks for the response.

I can compile not only simple C++ programs, but other, more complicated
ones. I have also successfully compiled and used other freeware
libraries
in the past few weeks. That's why I was so surprised about this kind of
problem.

Without the special hack, I could not get MySQL++ to compile - the
library
code compiled and linked but the examples wouldn't compile. I thought
Could you post the errors from the straight compile? I'm assuming they
are the same, but maybe there will be a clue. More info the better.

What compiler are you using? Is it possible to upgrade, or install a
side compiler for testing? I run gcc-4.0.0 in a separate user account
and home directory, since my system compiler is 3.3.4. This lets me
play easily with different compiler versions... and it may help rule out
a compiler problem in your case.

If you're interested in my script setup for this, I'll be happy to post
them.

- Chris


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



--=_alternative 00737AE78525701A_=--


Reply With Quote
  #6  
Old   
Dale Smith
 
Posts: n/a

Default Re: Link errors with resetdb example program - 06-08-2005 , 04:24 PM



--=_alternative 007591358525701A_=
Content-Type: text/plain; charset="US-ASCII"

Using the Intel compiler is a bit beyond what I know at this point. I
think I will have to change aclocal.m4 and some other files, so I can
re-generate the configure script. I don't have the knowledge necessary to
do this right now. Anyone know what it will take to do this? I did read up
on the GNU build tools, but wasn't able to spend the time necessary to
learn them beyond the basics.

Dale Smith, Ph.D.
dalesmith (AT) dtcc (DOT) com
DTCC Risk Management
Quantitative Group
212-855-7641




Chris Frey <cdfrey (AT) netdirect (DOT) ca>
06/08/2005 04:44 PM

To
plusplus (AT) lists (DOT) mysql.com
cc

Subject
Re: Link errors with resetdb example program






On Wed, Jun 08, 2005 at 04:31:45PM -0400, Dale Smith wrote:
Quote:
Thanks for the response.

I can compile not only simple C++ programs, but other, more complicated
ones. I have also successfully compiled and used other freeware
libraries
in the past few weeks. That's why I was so surprised about this kind of
problem.

Without the special hack, I could not get MySQL++ to compile - the
library
code compiled and linked but the examples wouldn't compile. I thought
Could you post the errors from the straight compile? I'm assuming they
are the same, but maybe there will be a clue. More info the better.

What compiler are you using? Is it possible to upgrade, or install a
side compiler for testing? I run gcc-4.0.0 in a separate user account
and home directory, since my system compiler is 3.3.4. This lets me
play easily with different compiler versions... and it may help rule out
a compiler problem in your case.

If you're interested in my script setup for this, I'll be happy to post
them.

- Chris


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



--=_alternative 007591358525701A_=--


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

Default Re: Link errors with resetdb example program - 06-08-2005 , 06:39 PM



On Wed, Jun 08, 2005 at 05:24:07PM -0400, Dale Smith wrote:
Quote:
Using the Intel compiler is a bit beyond what I know at this point. I
think I will have to change aclocal.m4 and some other files, so I can
re-generate the configure script. I don't have the knowledge necessary to
do this right now. Anyone know what it will take to do this? I did read up
on the GNU build tools, but wasn't able to spend the time necessary to
learn them beyond the basics.
I haven't used the intel compiler, but you shouldn't have to change
any of the configure scripts. Just run it with a different compiler
setting:

export CXXFLAGS="put your intel-specific flags here"
../configure \
CC=/path/bin/cc \
CPP=/path/bin/cpp \
CXX=/path/bin/c++ \
CXXCPP=/path/bin/cpp

This is how I specify various compilers... I hope intel isn't too much
different on the command line.

- 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
  #8  
Old   
Warren Young
 
Posts: n/a

Default Re: Link errors with resetdb example program - 06-14-2005 , 01:31 PM



Chris Frey wrote:
Quote:
On Mon, Jun 13, 2005 at 01:45:28PM -0600, Warren Young wrote:

Maintaining our own set of overloaded operator<< and >> seems like a lot
of work.
I agree, it's not practical to remove Query from the IOStreams class
hierarchy entirely. That's why, in another post, I suggested inheriting
instead from basic_ostream or something farther up the hierarchy, which
is designed to be inherited from. This would put Query completely in
charge of managing its own internal buffer, which would remove any
worries of some Standard C++ library doing odd things under the covers.
We should not depend on unspecified behavior.

--
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.