List:MySQL++« Previous MessageNext Message »
From:Charles A. Haines Date:September 14 2005 1:54pm
Subject:Link Error
View as plain text  
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
bin/SFXCounter.o(.text+0x11c): undefined reference to
bin/SFXCounter.o(.text+0x27b): undefined reference to
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@stripped

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. 

Link ErrorCharles A. Haines14 Sep
  • Re: Link ErrorWarren Young15 Sep