views:

306

answers:

2

Hi, i'm having trouble with Poco libraries. I need a simple solution to make the compilation easier. Is there any pkg-config file for Poco library to use it into our make files? Or any alternative solution? Currently i use Ubuntu gnu/linux.

A: 

sorry Duck, i'm a little new to this site. I'm trying to use poco libraries in my app, but i don't know how to link poco libraries to it. in fact i dont know how many libraries should be linkd against the app. I want to know if there is an easy way to do it, such as using pkg-config files, as we do in gtkmm, for example:

g++ prog.cc pkg-config --gtkmm-2.4 --libs --cflags -o prog

an the pkg-config program appends appropriate libs and header files to our command.

SepiDev
+1  A: 

I don't think Poco comes with any pre-packaged ".pc" files but you should be able to create your own easily and stick them in the lib/pkgconfig directory on your system if you prefer that method.

I don't know exactly where you installed Poco on your system so you may have to do a "find" to locate your files. To compile you need to specify the poco header directory, the poco library directory, and the individual poco libraries. So something like:

g++ -I<path-to-poco-include-dir> -o prog prog.cpp -L<path-to-poco-lib-dir> -l<some-poco-lib> -l<another-poco-lib> 

For example:

g++ -I/usr/local/Poco/include -o prog prog.cpp -L/usr/local/Poco/lib -lPocoFoundation -lPocoNet  -lPocoNetSSL -lPocoUtil -lPocoXML

There are 20 or so different poco .so files so you obviously need to link the proper ones. Poco makes this pretty easy since the library names conform to the documentation sections - e.g. util stuff is in libPocoUtil.so. If you also compiled debug versions of the libraries they will end in 'd' - e.g. libPocoUtild.so

Again, once you locate all your files you may prefer to create your own poco.pc since you should have the information you need to create it.

Duck