编译qtcreator源码,在make过程中报错(我这里是qtcreator4.4.1,其他版本也会有同样的错误,解决方法相同) g++ -c -pipe -fPIC -fpermissive -finline-functions -Wno-long-long -O2 -std=gnu++1y -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQTCSSH_LIBRARY -D'RELATIVE_PLUGIN_PATH="../lib/qtcreator/plugins"' -D'RELATIVE_LIBEXEC_PATH="../libexec/qtcreator"' -D'RELATIVE_DATA_PATH="../share/qtcreator"' -D'RELATIVE_DOC_PATH="../share/doc/qtcreator"' -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_RESTRICTED_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x050600 -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DBOTAN_DLL= -DBOTAN_TARGET_OS_HAS_GETTIMEOFDAY -DBOTAN_HAS_ALLOC_MMAP -DBOTAN_HAS_ENTROPY_SRC_DEV_RANDOM -DBOTAN_HAS_ENTROPY_SRC_EGD -DBOTAN_HAS_ENTROPY_SRC_FTW -DBOTAN_HAS_ENTROPY_SRC_UNIX -DBOTAN_HAS_MUTEX_PTHREAD -DBOTAN_HAS_PIPE_UNIXFD_IO -DBOTAN_TARGET_OS_IS_LINUX -DBOTAN_TARGET_OS_HAS_CLOCK_GETTIME -DBOTAN_TARGET_OS_HAS_DLOPEN -DBOTAN_TARGET_OS_HAS_GMTIME_R -DBOTAN_TARGET_OS_HAS_POSIX_MLOCK -DBOTAN_HAS_DYNAMICALLY_LOADED_ENGINE -DBOTAN_HAS_DYNAMIC_LOADER -DBOTAN_BUILD_COMPILER_IS_GCC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I../../../src -I../../../src -I../../libs -I/opt/qt-creator-opensource-src-4.4.1/tools -I../../plugins -I../3rdparty -I/opt/arm-qt/include -I/opt/arm-qt/include/QtWidgets -I/opt/arm-qt/include/QtGui -I/opt/arm-qt/include/QtNetwork -I/opt/arm-qt/include/QtConcurrent -I/opt/arm-qt/include/QtCore -I.moc/release-shared -I.uic -I/opt/arm-qt/mkspecs/linux-g++ -o .obj/release-shared/botan.o ../3rdparty/botan/botan.cpp ../3rdparty/botan/botan.cpp:46226:21: fatal error: cpuid.h: No such file or directory compilation terminated. Makefile:5559: recipe for target '.obj/release-shared/botan.o' failed make[3]: *** [.obj/release-shared/botan.o] Error 1 make[3]: Leaving directory '/opt/qt-creator-opensource-src-4.4.1/src/libs/ssh' Makefile:314: recipe for target 'sub-ssh-make_first' failed make[2]: *** [sub-ssh-make_first] Error 2 make[2]: Leaving directory '/opt/qt-creator-opensource-src-4.4.1/src/libs' Makefile:313: recipe for target 'sub-libs-make_first-ordered' failed make[1]: *** [sub-libs-make_first-ordered] Error 2 make[1]: Leaving directory '/opt/qt-creator-opensource-src-4.4.1/src' Makefile:45: recipe for target 'sub-src-make_first-ordered' failed make: *** [sub-src-make_first-ordered] Error 2 上网查找原因,据说是qtcreator的一个bug 需要替换qt-creator-opensource-src-4.4.1/src/libs/3rdparty/botan/目录下的botan.cpp与botan.h文件。 这里的资源就是需要替换的两个文件。 替换后,删除之前编译qtcreator时make过程中产生的中间文件,重新编译即可。
2022-03-21 09:43:46 810KB qtcreator源码编译
1