我正在尝试在MacOS上编译Qt5,使用gcc-8
而不是默认的clang
。通过本指南here,我已经能够使用以下命令进行配置:
CC=gcc-8 CXX=g++-8 CFORT=gfortran-8 ../configure --prefix=/Users/qth20/Utilities/qt-5.12 -opensource -nomake examples -nomake tests -platform g++-8
但当我检查详细输出时:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -pipe -g -fPIC -std=gnu11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.12 -fvisibility=hidden -w -fno-exceptions -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DPNG_ARM_NEON_OPT=0 -DPNG_POWERPC_VSX_OPT=0 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -isystem /Users/qth20/qt5/qtbase/src/3rdparty/libpng -I. -isystem /Users/qth20/qt5/qtbase/src/3rdparty/libpng -I/Users/qth20/qt5/qtbase/mkspecs/macx-clang -o .obj/debug/pngmem.o /Users/qth20/qt5/qtbase/src/3rdparty/libpng/pngmem.c
它似乎仍然在使用clang
而不是gcc-8
。有什么建议可以解决这个问题吗?
发布于 2019-04-24 20:07:36
只需使用macos-g++平台:../configure -platform macos-g++
然而,不能保证一切都是开箱即用的。
https://stackoverflow.com/questions/55820393
复制相似问题