I am trying to use POCO C++ Library with Netbeans IDE on Ubuntu Linux 13.04. I have downloaded, build and installed the POCO C++ Library. The library can be found in the directory "/usr/local/include/Poco". I would like to know how to add the POCO C++ Library to the Netbeans IDE and be able to work with it. Please answer with details.
Thank You
To link an external libraries you need in general three things:
-I
flag POCO C++ *.so
files -L
flag lib
prefix, for example with poco would be poco-Foundation
and the name of your file in your system would be libpoco-Foundation.so
Now for Netbeans specific
File -> Project Properties -> Build -> C++ Compiler -> General -> Include Directories
which is step one
Project -> properties -> Linker -> Additional Library Directories
which is step two
Project -> properties -> Linker ->Libraries -> Add option -> Other
is only for the library file, which is step three.
In the case of the Poco Libraries they are usually handled like the Boost Libraries, for example
#include "Poco/AutoPtr.h"
This means the Include Directory has to be one level up from the Poco
folder. For example if your Poco folder is on "/usr/local/include/Poco" then you need to add the "/usr/local/include" to your Include Directories (from step one).
As for the -L/usr/local/include/Poco
This is not how it is done. This path is the path to your specific library, in the case of poco
there is Foundation
, XML
, Net
, and Util
along with the test projects. You need to find the files that are named libPoco-*.so
where "*" means something. This is most likely in your the directory usr/local/lib
if those files are not there then they are most likely in usr/local/lib/Poco
libPoco-*.so
you have to build your Poco libraries separately.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.