Netbean C++ dlopen dynamic library

I develop c++ application with netbean, and i want to load my library with dlopen function, MY PROBLEM is i don'tn know how to configure netbean with shared library on debug?

#include <iostream>
#include <dlfcn.h>

int main() {
using std::cout;
using std::cerr;

 cout << "C++ dlopen demo\n\n";

// open the library
cout << "Opening hello.so...\n";
void* handle = dlopen("./hello.so", RTLD_LAZY);

if (!handle) {
    cerr << "Cannot open library: " << dlerror() << '\n';
    return 1;
}

// load the symbol
cout << "Loading symbol hello...\n";
typedef void (*hello_t)();

// reset errors
dlerror();
hello_t hello = (hello_t) dlsym(handle, "hello");
const char *dlsym_error = dlerror();
if (dlsym_error) {
    cerr << "Cannot load symbol 'hello': " << dlsym_error <<
        '\n';
    dlclose(handle);
    return 1;
}

// use it to do the calculation
cout << "Calling hello...\n";
hello();

// close the library
cout << "Closing library...\n";
dlclose(handle);
}

i see dlopen opening path library but how to configure netbean to load when i debugging the code?