我正在尝试为我的下一个项目设置一个环境(惊喜,包括提升),并遇到了一个问题。作为一个背景,c ++编译器和boost是从源代码构建的。无论如何,这是问题:
nchambers@nchambers-305E4A-305E5A-305E7A:~$ type g++-5.3.0
g++-5.3.0 is aliased to `g++-5.3.0 -I/home/nchambers/mini-bin/.binaries/boost_1_60_0/include -L/home/nchambers/mini-bin/.binaries/boost_1_60_0/lib'
nchambers@nchambers-305E4A-305E5A-305E7A:~$ cat test.cpp
#include <boost/regex.hpp>
#include <iostream>
#include <string>
int main()
{
std::string line;
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
}
nchambers@nchambers-305E4A-305E5A-305E7A:~$ g++-5.3.0 -std=c++14 -Wall -Wextra -w test.cpp -o boosttest -lboost_system -lboost_regex
nchambers@nchambers-305E4A-305E5A-305E7A:~$ ./boosttest
./boosttest: error while loading shared libraries: libboost_system.so.1.60.0: cannot open shared object file: No such file or directory
nchambers@nchambers-305E4A-305E5A-305E7A:~$ [[ -f mini-bin/.binaries/boost_1_60_0/lib/libboost_system.so.1.60.0 ]] && echo 'file exists'
file exists
nchambers@nchambers-305E4A-305E5A-305E7A:~$
非常感谢任何帮助!