Overview
Features
Download
Documentation
Community
Add-Ons & Services

Linking Error!

Please post support and help requests here.

Linking Error!

Postby panxpress » 25 Jun 2008, 06:06

Hi,

I am using the latest from SVN. The revision number is 608. I am trying to do the following:

I have 2 files. One .so library and another executable. I am trying to use some classes from .so in the executable.

In the .so library, I am trying to use Session and statements along with other Poco components like tasks and TaskManager. For Session and SQLite, I am using almost the same as the provided example.

I have derived a class called Command from Poco::Task.

All compiles fine in the library and the .so file gets generated without error.

In the executable file, I am deriving a new class called CCommandA from Command. This file compiles fine. I try to use this class in main method.

Everything compiles fine but in the linking state, I am getting error.

I am using Eclipse CDT and using the managed build system. Is there anything wrong I am doing?

Thanks,

Code: Select all

Invoking: GCC C++ Linker
g++ -L"/framework/Debug" -L"/usr/local/lib/" -o"framework.Test"  ./src/CommandA.o ./src/frameworkTest.o   -lframework -lPocoFoundationd
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Session::Session(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Statement::Statement(Poco::Data::Session&)'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Statement::Statement(Poco::Data::StatementImpl*)'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Statement::operator,(void (*)(Poco::Data::Statement&))'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::RecordSet::RecordSet(Poco::Data::Statement const&)'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::RecordSet::moveNext()'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Statement::addBind(Poco::Data::AbstractBinding*, bool)'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Statement::execute()'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::RecordSet::value(unsigned int, unsigned int) const'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::RecordSet::moveFirst()'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::AbstractBinding::AbstractBinding(std::basic_string, std::allocator > const&, Poco::Data::AbstractBinding::Direction, unsigned int)'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::AbstractBinding::~AbstractBinding()'
/framework/Debug/libframework.so: undefined reference to `typeinfo for Poco::Data::AbstractBinding'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::RecordSet::~RecordSet()'
/framework/Debug/libframework.so: undefined reference to `Poco::Data::Statement::~Statement()'
collect2: ld returned 1 exit status


panxpress
 
Posts: 7
Joined: 14 Jun 2008, 09:43

Re: Linking Error!

Postby alex » 25 Jun 2008, 11:08

> I am using Eclipse CDT and using the managed build system. Is there anything wrong I am doing?

You are not linking with Data and SQLite libraries. Try to add

Code: Select all

-lPocoDatad -lPocoSQLited


to your command line.
alex
 
Posts: 1132
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Linking Error!

Postby panxpress » 25 Jun 2008, 17:24

Thanks for the reply. I first looked at it but I could not find any library like that. Will these libraries be built as part of the make command? Do I have to run a separate command to build this?

Regards,
panxpress
 
Posts: 7
Joined: 14 Jun 2008, 09:43

Re: Linking Error!

Postby panxpress » 26 Jun 2008, 00:29

Ok, I got this to work. I was going over the forum and found a different thread which was discussing about the missing PocoData library. After manually editing the makefile, I was able to get the Data and SQLite library.

Regards,
panxpress
 
Posts: 7
Joined: 14 Jun 2008, 09:43

Re: Re: Linking Error!

Postby alex » 26 Jun 2008, 20:25

> Ok, I got this to work. I was going over the forum and found a different thread which was discussing about the missing PocoData library. After manually editing the makefile, I was able to get the Data and SQLite library.

I know, it's annoying. It'll go away once we implement the [https://sourceforge.net/tracker/index.php?func=detail&aid=2003214&group_id=132964&atid=725712|feature request] addressing this issue.
alex
 
Posts: 1132
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron