Overview
Features
Download
Documentation
Community
Add-Ons & Services

[RESOLVED] Statically linking

Please post support and help requests here.

[RESOLVED] Statically linking

Postby aderouineau » 30 Jun 2009, 03:39

Is it possible to link certain parts of the library statically to a program?

I was trying to create static libraries of the POCO framework without Data, Zip and Crypto; but at some point it spit out multiple "undefined reference" messages. Is there a way to bypass that or are the different parts of POCO *that* inter-dependant?
Last edited by aderouineau on 03 Jul 2009, 20:50, edited 1 time in total.
aderouineau
 
Posts: 163
Joined: 18 May 2009, 17:38

Re: Statically linking

Postby guenter » 30 Jun 2009, 11:25

There are only a few dependencies between the POCO Libraries.
Generally, all POCO libraries depend on Foundation.
XML depends on Foundation.
Util depends on Foundation and XML. You can avoid the dependency to XML if you build the XML library with -DPOCO_UTIL_NO_XMLCONFIGURATION
Net, Zip, Crypto and Data depend on Foundation only.
NetSSL depends on Foundation, Net and Util.

If you link statically on some platforms, the order in which you specify the libraries to the linker is important.
For example, if you specify this order:
PocoFoundation PocoXML PocoUtil
linking may fail.
If, however, you specify:
PocoUtil PocoXML PocoFoundation
linking will succeed.
guenter
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Statically linking

Postby aderouineau » 30 Jun 2009, 17:20

Ok thank you for that.

I added a new link in the TechNotes: http://pocoproject.org/wiki/index.php/TechNotes for this.
aderouineau
 
Posts: 163
Joined: 18 May 2009, 17:38


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest