gpt4 book ai didi

c++ - travis ci make -std=c++14 无法识别

转载 作者:行者123 更新时间:2023-11-30 03:36:59 24 4
gpt4 key购买 nike

在使用 travis ci 使用 premake ( https://travis-ci.org/S6066/Teal/builds/171980872 ) 构建我的项目时,出现错误 g++: error: unrecognized command line option ‘-std=c++14’
我的预制脚本:https://github.com/S6066/Teal/blob/master/build/premake5.lua
我的 travis ci 文件:https://github.com/S6066/Teal/blob/master/.travis.yml
感谢您的帮助。

编辑:g++ --version 给我 4.8.5,所以真正的问题是 Travis 不会用 g++ 6 编译

最佳答案

我为一个 github 项目编写了这些脚本并且 c++14 工作:

这是 .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++"

这是关联的 makefile:

all:
$(CXX) -std=c++14 main.cpp -I . -Os -Wall -Wextra -o Example
clean:
rm Example*

关于c++ - travis ci make -std=c++14 无法识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40408744/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com