2 messages in com.mysql.lists.plusplusRE: Linking errors| From | Sent On | Attachments |
|---|---|---|
| Joseph Richards | 23 Mar 2001 10:20 | |
| Reiland, Doug | 23 Mar 2001 13:21 |
| Subject: | RE: Linking errors![]() |
|---|---|
| From: | Reiland, Doug (doug...@intel.com) |
| Date: | 03/23/2001 01:21:09 PM |
| List: | com.mysql.lists.plusplus |
Why are all these compile and linking problems postings. Seems like people would pattern their stuff after the examples that you get for free when you download.
Here is the output I see when I compile the custom3.cc.
cc++ -DHAVE_CONFIG_H -I. -I. -I.. -I../splplusint -I../sqlplusint -I/usr/local/mysql/include/mysql -g -02 -c custom3.cc
c++ -g -02 -L/usr/local/lib/mysql -o ./libs/custom3.cc custom3.o util.o ../sqlplusint/.libs/libsqlplus.so -lz -lmysqlclient -lz -lmysqlclient -Wl,--rpath -Wl,/usr/local/lib
Now there are some things that stand out that you could remove from those lines, but I would get it to work first and then change it. You will probalby end up with something like:
cc++ -I<where sqplplus headers live> -I<where ever mysql headers live> -g -02 -o custom3 -L<where splplus lib lives> -L<where sql client lib lives> -lsqlplus -lz -lmysqlclient -lz
Good luck, doug
-----Original Message----- From: Joseph Richards [mailto:rich...@purdue.edu] Sent: Friday, March 23, 2001 1:21 PM To: plus...@lists.mysql.com Subject: Linking errors
I'm using the Mysql++ api to write a simple program to update entries in a database. When the program includes an assignment from the Result object to a sql_create'd data structure, I get the following link errors. This also occurs when I try to compile custom3.cc.
command> g++ -w -lz -lsqlplus -lmysqlclient -L/usr/lib/mysql/ custom3.cc
/tmp/ccJe4LAL.o: In function `mysql_ColData<const_string>::operator long long(void) const': /tmp/ccJe4LAL.o(.gnu.linkonce.t.__opx__Ct13mysql_ColData1Z12const_string+0x1 2): undefined reference to `long long mysql_ColData<const_string>::conv<long long>(long long) const' /tmp/ccJe4LAL.o: In function `mysql_ColData<const_string>::operator double(void) const': /tmp/ccJe4LAL.o(.gnu.linkonce.t.__opd__Ct13mysql_ColData1Z12const_string+0x1 2): undefined reference to `double mysql_ColData<const_string>::conv<double>(double) const' collect2: ld returned 1 exit status
I am using mysql++ v1.7.8 on RedHat 7.0. Any help would be appreciated.
Joe Richards




