【问题标题】:LLVM Clang 5.0 explicit in copy-initialization errorLLVM Clang 5.0 显式复制初始化错误
【发布时间】:2014-06-05 03:21:08
【问题描述】:

我正在尝试在 OSX 上编译一个仅在 Linux 上测试过的开源项目。

$: g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-da

我正在尝试使用以下命令行选项进行编译

g++ -MMD -Wall -std=c++0x -stdlib=libc++ -Wno-sign-compare -Wno-unused-variable -ftemplate-depth=1024 -I /usr/local/Cellar/boost/1.55.0/include/boost/ -g -O3 -c level.cpp -o obj-opt/level.o

我看到几个类似这样的错误:

./square.h:39:70: error: chosen constructor is explicit in copy-initialization
      int strength = 0, double flamability = 0, map<SquareType, int> constructions = {}, bool ticking = false);

该项目指出以下是 Linux 设置的要求。我怎样才能确认我正在这样做?

gcc-4.8.2
git
libboost 1.5+ with libboost-serialize
libsfml-dev 2+ (Ubuntu ppa that contains libsfml 2: )
freeglut-dev
libglew-dev

【问题讨论】:

  • 在没有任何反馈的情况下被否决。很有帮助
  • 这不是关于编程的问题,所以 StackOverflow 是问错地方了。尝试 SuperUser 或 ServerFault。
  • 不同意。编译是编程的一部分。但是,相关的源代码块在这里可能会有所帮助。

标签: c++ macos boost g++ llvm


【解决方案1】:

该项目要求您使用 gcc-4.8.2 进行编译,但您的 g++ 使用的是 clang,这是一个不同的编译器。

安装gcc-4.8.2或以上版本,并用它来编译你的项目

$ sudo port install gcc49

【讨论】:

猜你喜欢
  • 2019-02-27
  • 2013-06-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-16
  • 2021-05-15
  • 2016-10-29
  • 1970-01-01
相关资源
最近更新 更多