【发布时间】:2015-11-17 02:16:57
【问题描述】:
我正在尝试在我的机器 (Ubuntu 12.04 LTS) 和集群系统上的节点 (CentOS) 上为使用 boost 的项目构建可执行文件。我设法在两台机器上从源代码安装了 boost。当我运行make 命令时,我能够在我的机器上为我的项目获取可执行文件,但在节点上不是。在集群节点上,它说:
source/MainCompressor.cpp: In member function ‘void MainCompressor::compress(std::__cxx11::string, std::__cxx11::string)’:
source/MainCompressor.cpp:76:80: error: ‘boost::filesystem::basic_path<std::__cxx11::basic_string<char>, boost::filesystem::path_traits>::string_type {aka class std::__cxx11::basic_string<char>}’ has no member named ‘string’
boost::filesystem::copy_file(reference, outpath + reference.filename().string());
^
source/MainCompressor.cpp:93:49: error: ‘boost::filesystem::basic_path<std::__cxx11::basic_string<char>, boost::filesystem::path_traits>::string_type {aka class std::__cxx11::basic_string<char>}’ has no member named ‘string’
compList << outpath << reference.filename().string() << endl;
^
source/MainCompressor.cpp:99:47: error: ‘boost::filesystem::basic_path<std::__cxx11::basic_string<char>, boost::filesystem::path_traits>::string_type {aka class std::__cxx11::basic_string<char>}’ has no member named ‘string’
string filename = filepath.filename().string();
^
source/MainCompressor.cpp: In member function ‘void MainCompressor::decompress(std::__cxx11::string, std::__cxx11::string)’:
source/MainCompressor.cpp:171:47: error: ‘boost::filesystem::basic_path<std::__cxx11::basic_string<char>, boost::filesystem::path_traits>::string_type {aka class std::__cxx11::basic_string<char>}’ has no member named ‘string’
string filename = filepath.filename().string();
我在两台机器上都安装了相同版本的 boost(1.55 和 1.59)。我不确定为什么我的机器上没有出现错误,但节点上却出现了错误。在这方面的任何帮助将不胜感激。
编辑 1: 以下是我的路径变量设置:
PATH=/home/head/cmp/soft/sft/boost_1_59_0:/home/head/cmp/soft/sft/boost_1_55_0/bin:/home/head/cmp/soft/sft/gcc/bin:$PATH
【问题讨论】: