在linux下编译一个项目,用到了boost的一些类
用下面的方法编译
g++ main.cpp impurity.cpp tuple.cpp boosted_classify.cpp forest.cpp -lboost_thread -lpthread -O4 -o rtrank
一直提示 cannot find -lboost_thread
系统是安装过boost库的,所以这只是路径问题,要告诉编译器boost库的具体位置
g++ main.cpp impurity.cpp tuple.cpp boosted_classify.cpp forest.cpp -L/xxx/xxx/xxxx/library/boost/lib64 -lboost_thread -lpthread -O4 -o rtrank
还是提示上面的错误
到/xxx/xxx/xxxx/library/boost/lib64目录下看了,没有lboost_thread.a,只有libboost_thread-mt.a,于是将指令改为
g++ main.cpp impurity.cpp tuple.cpp boosted_classify.cpp forest.cpp -L/xxx/xxx/xxxx/library/boost/lib64 -lboost_thread-mt -lpthread -O4 -o rtrank
ok