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\n";
void* handle = dlopen("./", 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
hello_t hello = (hello_t) dlsym(handle, "hello");
const char *dlsym_error = dlerror();
if (dlsym_error) {
    cerr << "Cannot load symbol 'hello': " << dlsym_error <<
    return 1;

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

// close the library
cout << "Closing library...\n";

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