![](/img/trans.png)
[英]Understanding copy-initialization in C++, compared to explicit initialization
[英]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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.