LLVM Clang 5.0显式在复制初始化错误

LLVM Clang 5.0 explicit in copy-initialization error

本文关键字:复制 初始化 错误 Clang LLVM      更新时间:2023-10-16

我正在尝试在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
相关文章: