Overview
Features
Download
Documentation
Community
Add-Ons & Services

Linking Problems using Poco

Please post support and help requests here.

Linking Problems using Poco

Postby Draft » 12 Jun 2013, 20:10

Hello,

i have linking issues when compiling with gcc 4.6 on my linux system.

Example of Source Code:

Code: Select all
#include <Poco/Net/FTPClientSession.h>

using namespace std;

Poco::Net::FTPClientSession* Connection;

int main() {
string Server("Whatever");
int port = 21;
Connection = new Poco::Net::FTPClientSession(Server, port);
return 0;
}


result:
/tmp/ccrmjSWS.o: In function `main':
Poco_test.cpp:(.text+0x6e): undefined reference to `Poco::Net::FTPClientSession::FTPClientSession(std::string const&, unsigned short)'
collect2: Fehler: ld gab 1 als Ende-Status zurück

Version of Poco: 1.4.3

Is this a known bug ?
Draft
 
Posts: 5
Joined: 12 Jun 2013, 19:51

Re: Linking Problems using Poco

Postby guenter » 12 Jun 2013, 21:14

Have you linked the PocoNet library?
guenter
 
Posts: 1129
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Linking Problems using Poco

Postby Draft » 13 Jun 2013, 19:21

You mean something like g++ Poco_test.cpp -o Test -I /usr/include/Poco/Net/ with I as capital i ?

This is what i did.
Draft
 
Posts: 5
Joined: 12 Jun 2013, 19:51

Re: Linking Problems using Poco

Postby guenter » 13 Jun 2013, 19:29

No, I mean linking, with a lower-case L, as in:

Code: Select all
g++ Poco_test.cpp -o Test -l PocoNet -l PocoFoundation
guenter
 
Posts: 1129
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Linking Problems using Poco

Postby Draft » 14 Jun 2013, 11:29

Linking with -l also runs into troubles.

/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libPocoFoundation.so: undefined reference to `_pcre_ucd_stage1'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libPocoFoundation.so: undefined reference to `_pcre_ucd_records'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libPocoFoundation.so: undefined reference to `_pcre_ucp_gentype'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libPocoFoundation.so: undefined reference to `_pcre_ucd_stage2'
collect2: Fehler: ld gab 1 als Ende-Status zurück
Draft
 
Posts: 5
Joined: 12 Jun 2013, 19:51

Re: Linking Problems using Poco

Postby guenter » 14 Jun 2013, 11:43

Then you may want to add -lpcre as well to the command line.
guenter
 
Posts: 1129
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Linking Problems using Poco

Postby Draft » 14 Jun 2013, 12:09

g++ Poco_test.cpp -o Test -l PocoNet -l PocoFoundation -lpcre

Nothing changes, same result.

Appears to be the same issue like this guy https://github.com/pocoproject/poco/issues/120 .

I might need this patch or a newer version of Poco ?
Draft
 
Posts: 5
Joined: 12 Jun 2013, 19:51

Re: Linking Problems using Poco

Postby alex » 14 Jun 2013, 18:56

Draft wrote:I might need this patch or a newer version of Poco ?

This has not been fixed so far. You can (1) dirty-patch it as the Gentoo package builder did, (2) write a proper patch and send us pull request or (3) use bundled pcre.
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Linking Problems using Poco

Postby Draft » 16 Jun 2013, 19:52

Thanks for the quick help!

Are you going to fix it ?

If yes, I will keep an eye on the release notes.
Draft
 
Posts: 5
Joined: 12 Jun 2013, 19:51

Re: Linking Problems using Poco

Postby alex » 17 Jun 2013, 01:34

We'll fix it eventually. I was opposed to unbundled builds to start with as they open a can of worms and we have to support whatever users link with on their target platform. OTOH, I'm told distro packagers love unbundled builds. And, to be fair, this particular problem is due to an unhealthy coupling on our side. Since there is a simple workaround, at this time there is no timeframe for the fix. Perhaps someone with an itch stronger than ours shows up to help.
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest