c++ - Add library to existing project netbeans -
c++ - Add library to existing project netbeans -
i adding extensions (another persons) existing project @ company. want import existing library boost it. using netbeans debugging existing project. in order import library netbeans 2 steps followed:
include directories linker-> add together library.however when right click on existing project alternative of linker->add library not appearing. (though have included directories alternative there).
can please guide me how should add together library through linker existing project? project in c++
assuming using unix/linux variants:
directories headers , library linking 2 different things. include directories have headers needed, after compilation actual compiled code resides in libraries (*.a, *.so, etc...) might required.
for example, if using pthreads, apart headers need include, need libpthread.
when linking, need provide flag linking pthread i.e: -lpthread can search using find or locate on unix scheme find libraries. in case, in
/usr/lib/libpthread.so
therefore,
gcc myfile.c -lpthread -o myfile
will link myfile.c pthread library
whereas,
gcc -l/usr/local/lib/
tells gcc under /usr/local/lib search library (not header!).
telling netbeans headers are, isn't enough, give linking errors. telling netbeans libraries are, may enough, might utilize proper flags. if fails, have specify both library flags , path.
alternatively, may utilize tools cmake, make, etc automate process , provide bit more command imo.
see link 1 see link 2
c++ netbeans
Comments
Post a Comment