您好我需要使用Qt
(使用openmp
构建)编译cmake
项目。
到目前为止,我使用gcc-5
提供的homebrew
,但我想使用clang(我的口味......)
我通过clang-omp
安装了homebrew install clang-omp
,但现在当我尝试编译项目时(通过cmake -DCMAKE_CXX_COMPILER=/usr/local/bin/clang-omp++ ..
生成),我收到此错误:
cd /Users/tommaso/neutrino/debug/src && /usr/local/bin/clang-omp++ -DHAVE_HDF5 -DHAVE_JPEG -DHAVE_LIBCFITSIO -DHAVE_LIBCLFFT -DHAVE_LIBDF -DHAVE_LIBFFTW -DHAVE_LIBFFTW_THREADS -DHAVE_LIBGSL -DHAVE_LIBGSLCBLAS -DHAVE_LIBHDF5HL -DHAVE_LIBMFHDF -DHAVE_LIBNETPBM -DHAVE_LIBTIFF -DHAVE_NPHYSIMAGE -DHAVE_OPENCL -DHAVE_PYTHONQT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_PRINTSUPPORT_LIB -DQT_SQL_LIB -DQT_SVG_LIB -DQT_UIPLUGIN_LIB -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DUSE_QT5 -D__VER=\"osx-cmake-v2.0-75.bdff6e3\" -I/Users/tommaso/neutrino/debug/src -I/Users/tommaso/neutrino/src -I/usr/include/hdf -I/usr/local/include/netpbm -I/Library/Frameworks/qwt.framework/Headers -I/usr/local/Cellar/hdf5/1.8.16_1/include -I/usr/include/python2.7 -I/Users/tommaso/neutrino/src/../../pythonqt-code/src -I/Users/tommaso/neutrino/src/../../pythonqt-code/src/gui -I/Users/tommaso/pythonqt-code/src -I/Users/tommaso/pythonqt-code/extensions/PythonQt_QtAll -I/Users/tommaso/neutrino/src/python -iframework /usr/local/opt/qt5/lib -isystem /usr/local/opt/qt5/lib/QtCore.framework/Headers -isystem /usr/local/opt/qt5/./mkspecs/macx-clang -isystem /usr/local/opt/qt5/lib/QtGui.framework/Headers -isystem /System/Library/Frameworks/OpenGL.framework/Headers -isystem /usr/local/opt/qt5/lib/QtSql.framework/Headers -isystem /usr/local/opt/qt5/lib/QtWidgets.framework/Headers -isystem /usr/local/opt/qt5/lib/QtSvg.framework/Headers -isystem /usr/local/opt/qt5/lib/QtPrintSupport.framework/Headers -isystem /usr/local/opt/qt5/include -isystem /usr/local/opt/qt5/include/QtUiTools -isystem /usr/local/opt/qt5/lib/QtMultimedia.framework/Headers -isystem /usr/local/opt/qt5/lib/QtNetwork.framework/Headers -isystem /usr/local/opt/qt5/lib/QtMultimediaWidgets.framework/Headers -I/Users/tommaso/neutrino/debug -I/Users/tommaso/neutrino/src/graphics -I/Users/tommaso/neutrino/src/doc -I/Users/tommaso/neutrino/src/pans -I/Users/tommaso/neutrino/src/pans/VISAR -I/Users/tommaso/neutrino/src/pans/colorbar -I/Users/tommaso/neutrino/src/pans/winlist -I/Users/tommaso/neutrino/src/../nPhysImage -I/Users/tommaso/neutrino/nPhysImage -isystem /usr/local/opt/qt5/lib/QtUiPlugin.framework/Headers -O3 -fopenmp -fopenmp -O0 -ggdb -D__phys_debug=10 -std=c++11 -Wall -fPIC -mmacosx-version-min=10.6 -o CMakeFiles/Neutrino.dir/neutrino.cc.o -c /Users/tommaso/neutrino/src/neutrino.cc
In file included from /Users/tommaso/neutrino/src/neutrino.cc:26:
In file included from /usr/local/opt/qt5/lib/QtSvg.framework/Headers/QtSvg:3:
In file included from /usr/local/opt/qt5/include/QtSvg/QtSvgDepends:3:
In file included from /usr/local/opt/qt5/include/QtCore/QtCore:4:
In file included from /usr/local/opt/qt5/lib/QtCore.framework/Headers/qabstractanimation.h:37:
In file included from /usr/local/opt/qt5/include/QtCore/qobject.h:41:
/usr/local/opt/qt5/include/QtCore/qstring.h:739:55: error: no type named 'u16string' in namespace 'std'
static inline QString fromStdU16String(const std::u16string &s);
事实证明(如果我错了,请纠正我)我需要使用相同的clang-omp
编译器来编译qt。
当我尝试这个时,我认为没什么大不了的,但是homebrew
哭了:
HOMEBREW_CC=clang-omp HOMEBREW_CXX=clang-omp++ brew install -s qt5
Error: Invalid value for HOMEBREW_CC: clang-omp
那么有没有方法可以使用Qt
重建homebrew
?
是否有命令来获取homebrew
的可用编译器?
答案 0 :(得分:1)
使用不同的编译器重新编译Qt可能无法解决问题。
请看一下this other question而不是......
它也可能是Qt标头中的一个错误,它无法正确检测您的编译器,然后错误地认为它支持std::u16string
或者您可能忘了添加#include <string>