To link an external libraries you need in general three things:
- To add the header files as an include directory
-I
flag - To add the library path to your
POCO C++ *.so
files-L
flag - To add the library name to your compiler without the
lib
prefix, for example with poco would bepoco-Foundation
and the name of your file in your system would belibpoco-Foundation.so
Now for Netbeans specific
For the header files
File -> Project Properties -> Build -> C++ Compiler -> General -> Include Directories
which is step one
For the library directories
Project -> properties -> Linker -> Additional Library Directories
which is step two
For the library
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