johncarrie
johncarrie

Reputation: 9

Boost installation failed : cannot find -lrt

I had a trouble when I install the boost library(1.59.0) on my ubuntu 14.04.
I have executed ./b2 like the following:

./b2 install --exec-prefix=/usr/local --libdir=/root/boost/lib/ --includedir=/root/boost/include/ --with-system

But I have an error like this:

...found 22664 targets... ...updating 3 targets... gcc.link.dll bin.v2/libs/system/build/gcc-4.3.3/release/threading- multi/libboost_system.so.1.59.0 /usr/bin/ld: cannot find -lrt collect2: ld returned 1 exit status "g++" -o "bin.v2/libs/system/build/gcc-4.3.3/release/threading-multi/libboost_system.so.1.59.0" -Wl,-h -Wl,libboost_system.so.1.59.0 -shared -Wl,--start-group "bin.v2/libs/system/build/gcc-4.3.3/release/threading-multi/error_code.o" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -march=i686 -pthread -m32 ...failed gcc.link.dll bin.v2/libs/system/build/gcc-4.3.3/release/threading-multi/libboost_system.so.1.59.0...

How can I fix it? cannot find -lrt but I have librt-2.11.1.so in the /lib directory.

Thanks.

Upvotes: 0

Views: 3073

Answers (1)

Slava
Slava

Reputation: 44248

librt-2.11.1.so file is for runtime, for linking there should be .so symbolic link. Looks like you have package that installs rt but you missing dev package that provides necessary .so links. Did you install build-essential meta package?

Upvotes: 1

Related Questions