/usr/bin/ld: cannot find -lboost_thread-lpthread

时间:2019-03-19 15:18:42

标签: c++11 ubuntu binary

I was compiling my cpp binary files but I got following errors. I have searched a lot on internet but cannot find a solution.

g++ -std=c++11 -I/usr/include/boost/asio -I/usr/include/boost -o binary.out main.cpp connection.cpp connection_manager.cpp mime_types.cpp reply.cpp request_handler.cpp request_parser.cpp server.cpp -lboost_system -lboost_thread-lpthread

/usr/bin/ld: cannot find -lboost_thread-lpthread

collect2: error: ld returned 1 exit status

I have searched for lboost_thread-lpthread in the system and found it in the following location

/lib/x86_64-linux-gnu/libpthread.so.0

OS: ubuntu:16.04

Please help.

1 个答案:

答案 0 :(得分:0)

我认为您在命令行中的-lboost_thread和-lpthread之间需要一个空格。