I use Debian Jessie on amd64. I can't build the program, which uses Boost threads. Makefile http://pastebin.com/83h8MeUP returns http://pastebin.com/qffPLnCi . ld can't find -lboost_thread-mt (But g++ can). How can I make ld to see this lib?
Asked
Active
Viewed 139 times
0
-
1`g++` passes literally dozens of additional parameters and flags to `ld`. It's very intrinsic, don't even attempt to understand if you are not on the binutils dev team. Just link using `g++`. – Oct 13 '13 at 14:08
-
1Why don't you just use g++ as your linker then? `LD=g++` often works. – nneonneo Oct 13 '13 at 14:09
-
He is linking with g++, look at the makefile. I expect 'g++ can find the lib' really means g++ can find the header files. – john Oct 13 '13 at 14:09
-
1You probably need a -L option to tell it which directory has the boost libraries. – john Oct 13 '13 at 14:10
-
I have libboost_thread.a in /usr/lib, but there is no libboost_thread-mt. [here](http://stackoverflow.com/questions/3031768/boost-thread-linking-boost-thread-vs-boost-thread-mt) @paercebal says, that there must be no difference between mt and non-mt, but when I change lib name to boost_thread in makefile I get a lot of undefined references somewhere in mongodb code. In debian testing repos there is no separate -mt package. – user2650935 Oct 13 '13 at 14:35
-
What are the undefined references? – Igor R. Oct 13 '13 at 17:00
-
`/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libmongoclient.a(background.o): In function `mongo::BackgroundJob::go()': (.text+0x1c9f): undefined reference to `boost::thread::~thread()' ` – user2650935 Oct 13 '13 at 17:19