dbTalk Databases Forums  

problem linking even though I add the -lsqlpp and -lmysqlclient

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


Discuss problem linking even though I add the -lsqlpp and -lmysqlclient in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ankur G35 Saxena
 
Posts: n/a

Default problem linking even though I add the -lsqlpp and -lmysqlclient - 03-17-2005 , 10:42 AM






Hi, I have a little problem at hand, I am having trouble linking my code.

Here is the command I run


gcc Linux-i386/aaamain.o ../lib/Linux-i386/aaalib.a
.../../neoamcomm/Linux-i386/neoamlib.a ../../util/Linux-i386/utillib.a
.../util_lib/Linux-i386/autillib.a ../../AAALib/lib/Linux-i386/libaaa.a
-L/usr/lib -L/usr/local/lib -lmysqlpp -lpthread -lnsl -lm -lz
-lmysqlclient -lstdc++ -o Linux-i386/aaamain


Here are the errors I get, (Long long list, so i cut it short)

.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xfb): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/root/AAADev/AAALib/lib/AAALib.cpp:53: undefined reference to
`MysqlConnection::MysqlConnection[in-charge](char const*, char const*,
char const*, char const*, bool)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x21b): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/include/c++/3.2.2/bits/stl_bvector.h:133: undefined reference to
`SQLQuery::str(SQLQueryParms const&, query_reset)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x236):/usr/include/c++/3.2.2/bits/stl_bvector.h:111:
undefined reference to `MysqlConnection::store(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x315): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/include/c++/3.2.2/bits/basic_string.h:187: undefined reference to
`MysqlQuery::exec(std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x3e4):/usr/include/c++/3.2.2/bits/basic_string.h:187:
undefined reference to `MysqlResUse::~MysqlResUse [not-in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x484): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/include/c++/3.2.2/bits/stl_alloc.h:668: undefined reference to
`MysqlConnection::~MysqlConnection [in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x564):/usr/include/c++/3.2.2/bits/stl_alloc.h:664:
undefined reference to `MysqlQuery::exec(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x663): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/connection1.hh:92: undefined reference to
`SQLQuery::str(SQLQueryParms const&, query_reset)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x67e):/usr/local/include/connection1.hh:92:
undefined reference to `MysqlConnection::store(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xb2d): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/field_names1.hh:18: undefined reference to
`MysqlFieldNames::init(MysqlResUse const*)'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xe11): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/row1.hh:279: undefined reference to
`MysqlResUse::~MysqlResUse [not-in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xf5b): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/connection1.hh:54: undefined reference to
`MysqlResUse::~MysqlResUse [not-in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x11d4): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/result1.hh:160: undefined reference to
`MysqlResUse::~MysqlResUse [not-in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x1310):/usr/local/include/result1.hh:160:
undefined reference to `MysqlResUse::~MysqlResUse [not-in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x13b0): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/connection2.hh:7: undefined reference to
`MysqlConnection::~MysqlConnection [in-charge]()'
.../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x1569): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':


I have the libraries in the correct place and the include files in the
correct place as well..

What do I do?

Thanks
Ankur

--
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   
Ankur G35 Saxena
 
Posts: n/a

Default Re: problem linking even though I add the -lsqlpp and -lmysqlclient - 03-17-2005 , 10:45 AM






Also Here is my makefile if someone wanted to take a peek...

I had the exact same make file running on a another machine, with
probably an older version of mysql lib, so i changed the lib to sqlpp,
since that seems to be the newer name..

TOPDIR=../..

include $(TOPDIR)/Makeconfig

#
# You should put your special stuff here to override the ones defined
# in $(TOPDIR)/GNUmakeconfig.
#

include $(TOPDIR)/Makerules

#
# Define libraries to be linked in.
# NOTE: Libraries requiring functions supplied by another library must be
# listed BEFORE the library which supplies the function.
#

UTILLIB = utillib.a
AAALIB = aaalib.a
OAMLIB = neoamlib.a
AUTILLIB = autillib.a
NEWAAALIB = libaaa.a

APPLICATION_LIBS += ../lib/$(OBJDIR)/$(AAALIB)
APPLICATION_LIBS += $(TOPDIR)/neoamcomm/$(OBJDIR)/$(OAMLIB)
APPLICATION_LIBS += $(TOPDIR)/util/$(OBJDIR)/$(UTILLIB)
APPLICATION_LIBS += ../util_lib/$(OBJDIR)/$(AUTILLIB)
APPLICATION_LIBS += $(TOPDIR)/AAALib/lib/$(OBJDIR)/$(NEWAAALIB)

#LOCAL_LIBS+= -L/usr/lib/mysql -L/usr/local/lib
-L$(TOPDIR)/AAALib/mysql-lib -lsqlplus -lpthread -lnsl -lm -lstdc++
LOCAL_LIBS+= -lmysqlpp -lpthread -lnsl -lm -lz -lmysqlclient -lstdc++

#-lmysqlclient
# -L /opt/FSFlibg++/lib

#
#local includes
#
LOCAL_CFLAGS+= -I$(TOPDIR)/cncpbaseclass -I$(TOPDIR)/cc_aaa_msg
-I$(TOPDIR)/ccmsg -I../lib -I$(TOPDIR)/neoamcomm -I/usr/include/mysql
-I$(TOPDIR)/oammsg -I../util_lib -I$(TOPDIR)/AAALib/lib

#
# local library functions
#
OBJSRCS=

#
# runables
#
PROGSRCS= aaamain.cc

SRCS= $(OBJSRCS) $(PROGSRCS) # for creating depend

OBJS= $(OBJSRCS:%.cc=$(OBJDIR)/%.o)

PROGS= $(PROGSRCS:%.cc=$(EXEDIR)/%)

all:: $(OBJDIR) $(OBJDIR)/$(LIBTOOLS)($(OBJS))

all:: $(PROGS)
# mv $^ $(OBJDIR)


include $(TOPDIR)/Maketargets




On Thu, 17 Mar 2005 10:42:19 -0600, Ankur G35 Saxena <g35rider (AT) gmail (DOT) com> wrote:
Quote:
Hi, I have a little problem at hand, I am having trouble linking my code.

Here is the command I run

gcc Linux-i386/aaamain.o ../lib/Linux-i386/aaalib.a
../../neoamcomm/Linux-i386/neoamlib.a ../../util/Linux-i386/utillib.a
../util_lib/Linux-i386/autillib.a ../../AAALib/lib/Linux-i386/libaaa.a
-L/usr/lib -L/usr/local/lib -lmysqlpp -lpthread -lnsl -lm -lz
-lmysqlclient -lstdc++ -o Linux-i386/aaamain

Here are the errors I get, (Long long list, so i cut it short)

../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xfb): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/root/AAADev/AAALib/lib/AAALib.cpp:53: undefined reference to
`MysqlConnection::MysqlConnection[in-charge](char const*, char const*,
char const*, char const*, bool)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x21b): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/include/c++/3.2.2/bits/stl_bvector.h:133: undefined reference to
`SQLQuery::str(SQLQueryParms const&, query_reset)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x236):/usr/include/c++/3.2.2/bits/stl_bvector.h:111:
undefined reference to `MysqlConnection::store(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x315): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/include/c++/3.2.2/bits/basic_string.h:187: undefined reference to
`MysqlQuery::exec(std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x3e4):/usr/include/c++/3.2.2/bits/basic_string.h:187:
undefined reference to `MysqlResUse::~MysqlResUse [not-in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x484): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/include/c++/3.2.2/bits/stl_alloc.h:668: undefined reference to
`MysqlConnection::~MysqlConnection [in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x564):/usr/include/c++/3.2.2/bits/stl_alloc.h:664:
undefined reference to `MysqlQuery::exec(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x663): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/connection1.hh:92: undefined reference to
`SQLQuery::str(SQLQueryParms const&, query_reset)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x67e):/usr/local/include/connection1.hh:92:
undefined reference to `MysqlConnection::store(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xb2d): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/field_names1.hh:18: undefined reference to
`MysqlFieldNames::init(MysqlResUse const*)'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xe11): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/row1.hh:279: undefined reference to
`MysqlResUse::~MysqlResUse [not-in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0xf5b): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/connection1.hh:54: undefined reference to
`MysqlResUse::~MysqlResUse [not-in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x11d4): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/result1.hh:160: undefined reference to
`MysqlResUse::~MysqlResUse [not-in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x1310):/usr/local/include/result1.hh:160:
undefined reference to `MysqlResUse::~MysqlResUse [not-in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x13b0): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':
/usr/local/include/connection2.hh:7: undefined reference to
`MysqlConnection::~MysqlConnection [in-charge]()'
../../AAALib/lib/Linux-i386/libaaa.a(AAALib.o)(.text+0x1569): In
function `AAA::RegisterRoamingDevice(char*, char*, char*, char*,
char*)':

I have the libraries in the correct place and the include files in the
correct place as well..

What do I do?

Thanks
Ankur

--
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   
Chris Frey
 
Posts: n/a

Default Re: problem linking even though I add the -lsqlpp and -lmysqlclient - 03-17-2005 , 05:56 PM



On Thu, Mar 17, 2005 at 10:42:19AM -0600, Ankur G35 Saxena wrote:
Quote:
Hi, I have a little problem at hand, I am having trouble linking my code.
[snip]

Quote:
/usr/local/include/field_names1.hh:18: undefined reference to
These headers are pretty old. If possible, try removing _all_ old mysql++
versions from your system and installing the latest.

- 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
  #4  
Old   
Ankur G35 Saxena
 
Posts: n/a

Default Re: problem linking even though I add the -lsqlpp and -lmysqlclient - 03-18-2005 , 11:15 AM



Thanks
I didnt have older version installed, i think I didnt read things correctly...

One, the application library(my own) i was using to link with my app
was linked using an older version of MySQL++, since I had copied it to
my new computer and unfortunetly that lib dir was not present in my
make file (make clean command), so it was not getting cleaned whenever
I tried to do make clean.

Once that was fixed, i still had errors, since Row["col name"] was
removed and replaced by Row.lookup_by_name["col name"], once all these
changes were made, I was all set.

Thanks again for trying to help.

Ankur


On Thu, 17 Mar 2005 18:53:03 -0500, Chris Frey <cdfrey (AT) netdirect (DOT) ca> wrote:
Quote:
On Thu, Mar 17, 2005 at 10:42:19AM -0600, Ankur G35 Saxena wrote:
Hi, I have a little problem at hand, I am having trouble linking my code.

[snip]

/usr/local/include/field_names1.hh:18: undefined reference to

These headers are pretty old. If possible, try removing _all_ old mysql++
versions from your system and installing the latest.

- Chris

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


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