views:

109

answers:

3

properties/C/C++ Build/Settings GCC C++ Linker/Libraries

Under libraries(-I) I have libbost_system libbost_filesystem ... and under Library search path(-L) I have /home/etobkru/boost_1_43_0/boostBinaries/lib

but when I compile I get g++ -L/home/etobkru/boost_1_43_0/boostBinaries/lib/ -o"searchDirs" ./main.o -llibboost_system -llibboost_filesystem -llibboost_regex /usr/lib/gcc/i586-suse-linux/4.1.2/../../../../i586-suse-linux/bin/ld: cannot find -llibboost_system

I have tried with libbost_system.so and libbost_system.a but i get the same error. What am I doing wrong and why cant eclipse find the files. Because they are there?

A: 

You don't need the "lib" part in the name. Just link with

-lboost_system -lboost_filesystem -lboost_regex
Troubadour
thanks that works:)
hidayat
A: 

I think this is similar to http://stackoverflow.com/questions/2947239/usr-bin-ld-cannot-find-llibeststring-a

Did you try -lboost_system? The -l option doesn't expect the leading lib or the trailing .a or .so.

Mark B
Good call. It's a duplicate.
Troubadour
A: 

I know it's a little after the fact, but you can try -l:libbost_system.so and it will look for a library with exactly that name.

John Berryman