【问题标题】:Setting AppVeyor's C++ Language Standard设置 AppVeyor 的 C++ 语言标准
【发布时间】:2018-06-08 22:41:21
【问题描述】:

我正在尝试使用 AppVeyor 构建一个使用一些 c++17 功能的Visual Studio 2017 project。我将项目的语言标准设置为 c++latest,因此它可以在我本地的 Visual Studio 中正常编译,但 AppVeyor 无法成功构建它。我收到一堆这样的错误:

错误 C7525:内联变量至少需要 '/std:c++17'

Here's the AppVeyor page 这是我的 YAML 文件的内容。

version: 1.0.{build}
image: Visual Studio 2017 Preview

init:
- ps: >-
    cd "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\VC\Tools\MSVC\14.14.26428\include"

    svn checkout https://github.com/Microsoft/GSL/trunk/include/gsl

    cd C:\projects\fireemblem
environment:
  matrix:
   - additional_flags: "/std:c++latest"

before_build:
  - set CXXFLAGS=%additional_flags%

build:
  verbosity: normal

【问题讨论】:

  • 你会推荐使用什么来代替?
  • 当然是 Teamcity。
  • @WestonCarvalho:似乎这是 Visual Studio 唯一的设置。对于基于 msbuild 的 CI,人们似乎正在使用 additional_flags 环境变量。请在 GitHub 上查看appveyor.yml /std:c++latest 搜索的结果:github.com/…
  • 不知何故,我声称 appveyor 是垃圾的说法被删除了。我再说一遍,它是垃圾,避免它。如果您不喜欢 Teamcity,请使用 Jenkins,不要使用 appveyor。
  • @WestonCarvalho 还注意到- set CXXFLAGS=%additional_flags% 需要在构建之前的某个时间。

标签: c++ msbuild visual-studio-2017 appveyor


【解决方案1】:

确保为项目文件中的每个配置设置<LanguageStandard>stdcpplatest</LanguageStandard>,而不仅仅是win32调试配置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-19
    • 2012-03-25
    • 2013-02-10
    • 1970-01-01
    • 1970-01-01
    • 2014-12-08
    • 1970-01-01
    相关资源
    最近更新 更多