How to build Qt 5 from source with c++14 support

前提是你 提交于 2019-12-13 12:32:05

问题


I am attempting to build Qt 5.4.1 pulled from git with the -std=c++14 flag for gcc4.9. But I am not sure about how to properly pass the flag into the build process.

I have read that adding CONFIG += c++14 to a qt project file should work since Qt5.4, so I have added it into the qt.pro located in the top folder.

But Qt is still compiled with -std=c++0x (c++11).


回答1:


If you using g++ or clang++ to build the Qt 5, then go to qt5/qtbase/mkspecs/common/g++-base.conf or qt5/qtbase/mkspecs/common/clang.conf respectively and simply change the right hand side of QMAKE_CXXFLAGS_CXX11 = -std=c++11 assignment to (for example) -std=gnu++1z (or to whatever you need).

To build Qt 5 you have to run qt5/configure script with -c++11 provided (and -platform linux-clang-libc++ or linux-clang or linux-g++ or whatever you need — the parameter is the qt/qtbase/mkspecs/*/ directory name represented your platform).



来源:https://stackoverflow.com/questions/28551609/how-to-build-qt-5-from-source-with-c14-support

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!