调用 'std::basic_ifstream<char>::basic_ifstream(std::__cxx11::string&)' ifstream myfile(文件名)没有



我正在使用Cmake和Ctest尝试在Travis CI上测试我的代码。如果我使用Cmake进行本地测试,我不会出现任何错误,而且我可以进行测试。当通过Travis CI运行测试时,我会收到很多错误,比如这个:

error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::__cxx11::string&)’
ifstream myfile(filename);

文件名是一个字符串。travis运行的编译器版本与我的本地设置不同吗?

Travis CI C++版本需要更新。

这是完整的.travis.yml

language: cpp
compiler: gcc
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test 
packages:
- g++-7
compiler:
- clang
script:
- export CC=gcc-7
- export CXX=g++-7
- gcc -v && g++ -v && cmake --version
- cmake ./Computing project/Test Mains/

最新更新