无法识别的命令行选项'-stdlib = libc ++'gcc(Homebrew gcc 5.3.0)5.3.0 [英] unrecognized command line option '-stdlib=libc++' gcc (Homebrew gcc 5.3.0) 5.3.0

查看:2042
本文介绍了无法识别的命令行选项'-stdlib = libc ++'gcc(Homebrew gcc 5.3.0)5.3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行Mac OSX El Capitan,通过Homebrew gcc version 5.3.0安装。

I run Mac OSX El Capitan, I have installed via Homebrew gcc version 5.3.0.

我想安装pyopencl(但据我了解,问题),我得到了以下错误:

gcc -fno-strict-aliasing -fwrapv -Wall -O3 -DNDEBUG -DPYGPU_PACKAGE = pyopencl -DPYGPU_PYOPENCL = 1 -Isrc / c_wrapper / -I / Users / earendilllock / anaconda / include / python2.7 -c build / temp.macosx-10.5-x86_64-2.7 / pyopencl._cffi.cpp -o build / temp.macosx-10.5-x86_64-2.7 / build /temp.macosx-10.5-x86_64-2.7/pyopencl._cffi.o -std = c ++ 0x -stdlib = libc ++ -mmacosx-version-min = 10.7 -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/目录/ Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.11.sdk
gcc:错误:无法识别的命令行选项'-stdlib = libc ++'
错误:命令'gcc'失败,退出状态1
make:*** [all]错误1

I want to install pyopencl (but as I understand it doesn't matter) and I have obtained the following error: gcc -fno-strict-aliasing -fwrapv -Wall -O3 -DNDEBUG -DPYGPU_PACKAGE=pyopencl -DPYGPU_PYOPENCL=1 -Isrc/c_wrapper/ -I/Users/earendilllock/anaconda/include/python2.7 -c build/temp.macosx-10.5-x86_64-2.7/pyopencl._cffi.cpp -o build/temp.macosx-10.5-x86_64-2.7/build/temp.macosx-10.5-x86_64-2.7/pyopencl._cffi.o -std=c++0x -stdlib=libc++ -mmacosx-version-min=10.7 -arch i386 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk gcc: error: unrecognized command line option '-stdlib=libc++' error: command 'gcc' failed with exit status 1 make: *** [all] Error 1

我无法找到解决方案这个问题通过谷歌,但我希望它存在。

I could not find the solution for resolving that problem via Google, but I hope it exists.

推荐答案

正如错误消息所示,gcc编译器没有像 -stdlib 这样的命令行选项。 。 LLVM clang编译器可以。
这是因为clang为您提供链接LLVM标准C ++库( libc ++ )或
GNU标准C ++库( libstdc ++ ),而gcc只支持 libstdc ++

As the error message says, the gcc compiler has no such commandline option as -stdlib. The LLVM clang compiler does. That is because clang offers you the choice of linking the LLVM standard C++ library (libc++) or the GNU standard C++ library (libstdc++), whereas gcc supports only libstdc++.

删除选项 -stdlib = libc的++ 。你也可以用 -std = c ++ 11 ,$ b替换 -std = c ++ 0x $ b因为前者表示对2011版C ++ 11标准的实验性支持,适用于gcc版本
4.3至4.6。

Delete the option -stdlib=libc++. You might as well also replace -std=c++0x with -std=c++11, since the former denotes experimental support for the 2011 C++11 standard, applicable for gcc versions 4.3 through 4.6.

这篇关于无法识别的命令行选项'-stdlib = libc ++'gcc(Homebrew gcc 5.3.0)5.3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆