0

I am using Cmake and Ctest to try and test my code on Travis CI. If I use cmake to test locally I get no errors what so ever and I can make my tests. When running the test through Travis CI I get loads of errors such as this one:

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

ifstream myfile(filename);

The filename is a string. Is travis running a different version compiler to my local setup?

Hitokiri
  • 3,607
  • 1
  • 9
  • 29
mbh16_x
  • 1
  • 1

1 Answers1

0

The Travis CI C++ version needed to be updated.

here is the full .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/

mbh16_x
  • 1
  • 1