Configuring Netbeans to Debug a C++ program containing non standard libraries -


i want use non standard library ( igraph c library ) build 'hello world' program in c++, using netbeans.

i want use debug features of netbeans too.

first followed installation instructions provided library vendor, used terminal compile , run a hello world program supplied library vendor. compiles & runs fine using terminal.

the problem open c project file in netbeans, must configure can :

  1. run program
  2. debug program

netbeans lets run , debug c++ programs off bat, if using standard libraries. read on forums configuration needs done if want make netbeans run , debug c++ programs containing non standard libraries

i found answer. here steps :

1. find out non standard library files installed

on ubuntu used following command find out location of installed files :

pkg-config --libs --cflags igraph 

in above command have substitute igraph name of non standard library installed.

this command gave me following output :

-i/usr/local/include/igraph  -l/usr/local/lib -ligraph 

i noted down path after -i, path after -l , string after -l. these 3 need fed inside netbeans in steps below

source: http://igraph.org/c/doc/igraph-tutorial.html#idm470953198960

2. configure netbeans

right click on project in netbeans -> properties -> linker ->libraries -> add option -> other -> type -ligraph in here

in case have type found instead of -ligraph on system during step #1

project -> properties -> linker -> additional library directories > typed /usr/local/lib in here

in case have use path got on system after -l flag in step #1

project -> properties -> c++ compiler -> include directories -> typed /usr/local/include/igraph in here

in case have use path got on system after -i flag in step #1

source: https://stackoverflow.com/a/13292276/3143538

add project->properties->run->environment :

name: ld_library_path value: $ld_library_path:/usr/local/lib 

instead of /usr/local/lib have use path got after -l flag in step #1

source: https://askubuntu.com/questions/267071/ld-library-path-specification

after above steps, able both compile, run, , debug program


Comments