hi I have this error in both eclipse and netbeans, I have mydynamiclib.so file when i add it to eclipse or netbeans and try to build i get the this error netbeans:
collect2: ld returned 1 exit status
make[2]: * [dist/Debug/GNU-Linux-x86/myapp] Error 1
/usr/bin/ld: cannot find -lmydynamiclib
I’m using most recent versions of (ubuntu 10.10 ,netbeans, eclipse)
You
need the libmydynamiclib.a fileas well as the .so file and you should tell ld or gcc where to find it too.e.g.
gcc -o myapp -L/path/to/lib -lmydynamiclibwhere libmydynamiclib.so lives in /path/to/lib.
Otherwise, don’t link the library, but use dlopen() to load it dynamically. See the dlopen() manpage.