1

I have the error g++: error: unrecognized command line option ‘-std=c++14’ when building my project with travis ci using premake (https://travis-ci.org/S6066/Teal/builds/171980872)
My premake script: https://github.com/S6066/Teal/blob/master/build/premake5.lua
My travis ci file: https://github.com/S6066/Teal/blob/master/.travis.yml
Thanks for help.

Edit: g++ --version gives me 4.8.5, so the real problem is Travis won't compile with g++ 6

Random Coder 99
  • 376
  • 1
  • 15

1 Answers1

2

I did these scripts for a github project and c++14 works:

This is an example of a .travis.yml:

sudo: required
dist: trusty
language: cpp
compiler: g++
install: export CXX="g++-5"
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-5
notifications:
 email:
  on_success: never
  on_failure: always
before_install: sudo apt-get update -qq
script: make --directory "Var & ReadOnly C++"

And this is the associated makefile:

all:
    $(CXX) -std=c++14 main.cpp -I . -Os -Wall -Wextra -o Example
clean:
    rm Example*
Daniel Illescas
  • 5,346
  • 3
  • 17
  • 23
  • Look, this is the project where I use the script: https://github.com/illescasDaniel/Var-ReadOnly This is the travis ci output: https://travis-ci.org/illescasDaniel/Var-ReadOnly As you can see, the build is passing – Daniel Illescas Nov 04 '16 at 18:40
  • Thanks, exporting CXX worked for me, even if g++ --version still gives me g++ 4.8.5 – Random Coder 99 Nov 05 '16 at 10:24