HELP!error while loading shared libraries: ?: cannot open shared object file: No such file or directory [Netbeans 8.1]

I am looking for help urgently..I downloaded boost 1_40_0(I need old version) and install it in Cygwin directory. The Directory is c:/Cygwin/usr/local/include/boost and c:\Cygwin\usr\local\lib.Then I link the boost library to Netbeans:

(1) I add "c:\Cygwin\usr\local\include\boost" in the C++ Compiler in the Code Assistance;

(2) I created a project and enter into the "properties", and then in C++ Complier I included Directories "c:\Cygwin\usr\local\include\boost", and then went to Linker, add "c:\Cygwin\usr\local\lib" to Additional Library Directories, and add all the libraries(.a file) in c:\Cygwin\usr\local\lib to Libraries.

After that, the code I wrote can be built successfully. But when I run this code, there are some errors:

cd 'D:\NetBeansProject\test_boost_filesystem'
C:\cygwin\bin\make.exe -f Makefile CONF=Debug clean
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Entering directory '/cygdrive/d/NetBeansProject/test_boost_filesystem'
rm -f -r build/Debug
rm -f dist/Debug/Cygwin-Windows/test_boost_filesystem.exe
make[1]: Leaving directory '/cygdrive/d/NetBeansProject/test_boost_filesystem'

CLEAN SUCCESSFUL (total time: 1s)
cd 'D:\NetBeansProject\test_boost_filesystem'
C:\cygwin\bin\make.exe -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/d/NetBeansProject/test_boost_filesystem'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/test_boost_filesystem.exe
make[2]: Entering directory '/cygdrive/d/NetBeansProject/test_boost_filesystem'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
g++ -c -g -I/cygdrive/C/cygwin/usr/local/include/boost -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.cpp
mkdir -p dist/Debug/Cygwin-Windows
g++ -o dist/Debug/Cygwin-Windows/test_boost_filesystem build/Debug/Cygwin-Windows/main.o -L/cygdrive/C/cygwin/usr/local/lib -lboost_date_time -lboost_date_time.dll -lboost_filesystem -lboost_filesystem.dll -lboost_graph -lboost_graph.dll -lboost_math_c99 -lboost_math_c99.dll -lboost_math_c99f -lboost_math_c99f.dll -lboost_math_tr1 -lboost_math_tr1.dll -lboost_math_tr1f -lboost_math_tr1f.dll -lboost_prg_exec_monitor -lboost_prg_exec_monitor.dll -lboost_program_options -lboost_program_options.dll -lboost_python -lboost_python.dll -lboost_regex -lboost_regex.dll -lboost_serialization -lboost_serialization.dll -lboost_signals -lboost_signals.dll -lboost_system -lboost_system.dll -lboost_test_exec_monitor -lboost_unit_test_framework -lboost_unit_test_framework.dll -lboost_wave
make[2]: Leaving directory '/cygdrive/d/NetBeansProject/test_boost_filesystem'
make[1]: Leaving directory '/cygdrive/d/NetBeansProject/test_boost_filesystem'

BUILD SUCCESSFUL (total time: 7s)


**D:/NetBeansProject/test_boost_filesystem/dist/Debug/Cygwin-Windows/test_boost_filesystem.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

RUN FAILED (exit value 127, total time: 125ms)**

the code is as follows:

#include <iostream>
#include <boost/filesystem.hpp>
using namespace boost::filesystem;

int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout << "Usage: tut1 path\n";
return 1;
}
std::cout << argv[1] << " " << file_size(argv[1]) << '\n';
return 0;
}

I am a beginner in C++. and I checked so many websites but still cannot get the solution. And I even am not sure if I linked the boost library with Netbeans correctly..PLEASE give me some suggestions!! Thanks soooooo much!!!!

Regards, lyu
the thing is use have to the corect .so of boost library .For example when you are using <boos/random.hpp>
you have to link it on makefile as '-lboost_random' .You have to link it like this on the makefile.
You're asking for trouble.

Forget Netbeans and all that crap. Do everything in cygwin.
Topic archived. No new replies allowed.