tags:

views:

91

answers:

1

I have a C++ project on eclipse which compiles and runs fine from eclipse, but when trying to run it from the terminal inside the workspace directory, i get the following error :

./my_project: error while loading shared libraries: libstdc++.so.3: cannot open shared object file: No such file or directory

What can be the problem?

A: 

It's likely that Eclipse is adding libstdc++.so.3 to your LD_LIBRARY_PATH environment variable when you run it inside of eclipse, but it isn't there in your regular shell.

Check to make sure LD_LIBRARY_PATH is defined and includes all the necessary libraries your program needs and you should be good.

Eric Petroelje
I figured out that my system does not have libstdc++.so.3 file. When i echo $LD_LIBRARY_PATH, it includes the path where libstdc++.so.6 is present.
rayimag