0
问题:我的文件在本地虚拟机(LVM)上编译,但不在Institute服务器(IS)上编译。仅在远程计算机上对Boost库进行未定义的引用
LVM和IS安装了相同版本的Boost库(从源代码安装)。
随着bashrc
文件与环境变量PATH
和LD_LIBRARY_PATH
更新的Boost
如下:
在LVM:
PATH=/home/X/my_lib/boost_1_64_0:$PATH
LD_LIBRARY_PATH=/home/X/my_lib/boost_1_64_0/stage/lib:$LD_LIBRARY_PATH
export PATH
export LD_LIBRARY_PATH
上:
PATH=/user/X/my_lib/boost_1_64_0:$PATH
LD_LIBRARY_PATH=/user/X/my_lib/boost_1_64_0/stage/lib:$LD_LIBRARY_PATH
export PATH
export LD_LIBRARY_PATH
文件都编上LVM与以下命令:
g++ -std=c++11 -O3 benchmark_ad_tree.cpp blank_scoring_function.cpp fnml_scoring_function.cpp log_likelihood_calculator.cpp bdeu_scoring_function.cpp bayesian_network.cpp score_calculator.cpp ad_tree.cpp -o check -L /home/X/my_lib/boost_1_64_0/stage/lib/*.so
然而,当同样的命令用来编译相同的代码上它抛出异常下面一串:
g++ -std=c++11 -O3 benchmark_ad_tree.cpp blank_scoring_function.cpp fnml_scoring_function.cpp log_likelihood_calculator.cpp bdeu_scoring_function.cpp bayesian_network.cpp score_calculator.cpp ad_tree.cpp -o check /user/X/my_lib/boost_1_64_0/stage/lib/*.so
更新: 继从@约翰Zwinck的建议(在回答部分)。
我已经更新了编译命令
例外提出:
g++ -std=c++11 -O3 benchmark_ad_tree.cpp blank_scoring_function.cpp fnml_scoring_function.cpp log_likelihood_calculator.cpp bdeu_scoring_function.cpp bayesian_network.cpp score_calculator.cpp ad_tree.cpp -o check -L /user/X/my_lib/boost_1_64_0/stage/lib -lboost_numpy -lboost_python -lboost_thread
引发的异常:
/usr/bin/ld: /tmp/ccWojrSj.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/user/X/my_lib/boost_1_64_0/stage/lib/libboost_system.so.1.64.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
我试过了以下命令:'g ++ -std = C++ 11 -O3 benchmark_ad_tree.cpp blank_scoring_function.cpp fnml_scoring_function.cpp log_likelihood_calculator.cpp bdeu_scoring_function.cpp bayesian_network.cpp score_calculator.cpp ad_tree.cpp -o check -L /用户/ X/my_lib/boost_1_64_0/stage/lib -lboost_numpy -lboost_python' .....我更新了帖子,但我得到了异常 – letsBeePolite
我进一步更新了帖子 – letsBeePolite
U很需要'-lboost_system' –