m******h 发帖数: 1059 | 1 Hi,
I wanted to use the thread functions of boost,
here is the program
#include
#include
int main()
{
boost::mutex m;
return 0;
}
and I'm using g++ to compile, with these options
-L/root/boost/lib -lboost_thread-gcc41-mt-1_37 -static
The error message is:
undefined reference to `boost::mutex::mutex()'
I actually got the similar problem the day before yesterady for date_time
but the issue was resolved by adding
-lboost_date_time-gcc41-mt- |
y*******g 发帖数: 6599 | 2 我用 g++ mutex.cpp -L /usr/local/lib/ -l boost_thread-gcc42-mt
编译通过.
【在 m******h 的大作中提到】 : Hi, : I wanted to use the thread functions of boost, : here is the program : #include : #include : int main() : { : boost::mutex m; : return 0; : }
|
m******h 发帖数: 1059 | 3 谢谢!还帮我测试了一下
不过我现在更郁闷了,这到底是什么问题啊
【在 y*******g 的大作中提到】 : 我用 g++ mutex.cpp -L /usr/local/lib/ -l boost_thread-gcc42-mt : 编译通过.
|
r*********r 发帖数: 3195 | 4 the option -static is what's wrong. |
d***q 发帖数: 1119 | 5 你的thread 是编译成什么库德
.so? .dll 还是 一般的.a
不一样的。 |
m******h 发帖数: 1059 | 6 no, even without -static, still the same error |