dbTalk Databases Forums  

Link Error

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


Discuss Link Error in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Haines, Charles A.
 
Posts: n/a

Default Link Error - 09-14-2005 , 08:57 AM






I know this is a stupid question, but I'm having a brain fart today.

I'm trying to compile and link my application with mysql++. I an doing the
following in a make file:

QCC -c -o bin/CounterCard.o src/CounterCard.cpp
QCC -I/usr/include -I/usr/lib -I/usr/local/mysql/include -L/usr/lib
-L/usr/local/mysql/lib -lm -lsocket -lmysqlpp -lmysqlclient -lz -c -o
bin/SFXCounter.o src/SFXCounter.cpp
QCC -L/usr/lib -L/usr/local/mysql/lib -lm -lsocket -lmysqlpp -lmysqlclient
-lz -o bin/SFXCounter bin/CounterCard.o bin/SFXCounter.o

When the compilter gets to the third line, I am getting the following error:

bin/SFXCounter.o: In function `main':
bin/SFXCounter.o(.text+0xa7): undefined reference to
`mysqlpp::Connection::Connection(bool)'
bin/SFXCounter.o(.text+0x11c): undefined reference to
`mysqlpp::Connection::~Connection()'
bin/SFXCounter.o(.text+0x27b): undefined reference to
`mysqlpp::Connection::~Connection()'
bin/SFXCounter.o: In function `connectToDB(mysqlpp::Connection&)':
bin/SFXCounter.o(.text+0x3bf): undefined reference to
`mysqlpp::Connection::connect(char const*, char const*, char const*, char
const*, unsigned, char, unsigned, char const*, unsigned)'
cc: /usr/qnx630/host/qnx6/x86/usr/bin/i386-pc-nto-qnx6.3.0-ld error 1

Usually this is because I'm not linking against the mysqlpp library, but in
this case I'm included both it's location and the linking against list.
Anyone have any idea what I'm doing wrong? I'm sure it's simple, I just
can't think today.

--
Charles Haines
Software Engineer / QA
Bechtel Nevada
Remote Sensing Lab - Andrews
------------------------------
Phone: (301) 817-3409
Pager: (800) 759-8888 #1209278
Email: hainesca (AT) nv (DOT) doe.gov
------------------------------

This e-mail and any attachments may contain privacy act information. If you
received this message in error or are not the intended recipient, you should
destroy this message and any attachments, and you are prohibited from
retaining, distributing, disclosing, or using any information contained
herein. Please inform us of the erroneous delivery by return e-mail. Thank
you for your cooperation.


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

Default Re: Link Error - 09-14-2005 , 05:25 PM






Haines, Charles A. wrote:
Quote:
QCC -L/usr/lib -L/usr/local/mysql/lib -lm -lsocket -lmysqlpp -lmysqlclient
-lz -o bin/SFXCounter bin/CounterCard.o bin/SFXCounter.o
Order of parameters matters to most linkers. You want the least generic
things (e.g. your program objects) first, and the most generic things
(e.g. libm) last. libmysqlpp and libmysqlclient come in the middle, in
that order.

Quote:
Usually this is because I'm not linking against the mysqlpp library,
Are you saying that you have gotten it to work before? I hope for a
success report when you do get it working.

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