LLVM Clang 5.0显式在复制初始化错误
LLVM Clang 5.0 explicit in copy-initialization error
我正在尝试在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
项目要求你使用gcc-4.8.2进行编译,但是你的g++使用的是clang,这是一个不同的编译器。
安装gcc-4.8.2或以上版本,并使用它来编译您的项目
$ sudo port install gcc49
相关文章:
- 不能将复制初始化与隐式转换的多个步骤一起使用
- 在引用初始化中使用已删除的复制构造函数进行复制初始化
- 为什么 std::string s = "123" 当不涉及副本时被视为复制初始化?
- 复制初始化:为什么即使关闭了复制省略,也没有调用move或copy构造函数
- 复制初始化与直接初始化已更改
- 为什么在直接初始化和赋值中传递 lambda 而不是在复制初始化中传递 lambda 时会编译?
- 复制初始化 - 从 'int' 类型转换为非标量类型
- 我可以制作一个对象方法,如果单独调用,它将自行修改,但如果在复制初始化期间调用,则会返回一个新对象?
- 如果值来自成员变量,则复制初始化和参考初始化之间的C 差异
- 复制初始化表单 '= {}'
- 对C++所做的更改使复制初始化适用于具有显式构造函数的类
- 显式强制转换、直接初始化和复制初始化之间的行为不同
- 是直接初始化还是复制初始化
- 为什么复制初始化是这样的?为什么需要复制构造函数
- 在复制初始化中,对复制构造函数的调用是显式的还是隐式的
- 复制列表初始化和传统复制初始化之间的任何区别
- 复制初始化和显式构造函数-编译器的差异
- 如何为显式重载构造函数启用复制初始化
- POD变量的直接初始化不起作用,但当将变量推到向量上时,复制初始化起作用
- 为什么类构造函数在通过复制初始化对象时不起作用