當我試圖以獲得Windows部署,所有依賴一個獨立的應用程序編譯Qt 5.7
靜態作爲mentionned here我得到了以下錯誤:如何在使用MinGW靜態構建Qt 5.7時如何解決此構建錯誤?
C:\Qt\Qt5.7.0\5.7\Src\qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QByteArray QMakeEvaluator::getCommandOutput(const QString&) const'
C:\Qt\Qt5.7.0\5.7\Src\qtbase/qmake/library/qmakebuiltins.cpp:419:94: error: '_popen' was not declared in this scope + QLatin1String(" && ") + args).toLocal8Bit().constData(), "r")) {
C:\Qt\Qt5.7.0\5.7\Src\qtbase/qmake/library/qmakebuiltins.cpp:427:23: error: '_pclose' was not declared in this scope QT_PCLOSE(proc);
Makefile:204: recipe for target 'qmakebuiltins.o' failed mingw32-make: *** [qmakebuiltins.o] Error 1 Building qmake failed, return code 2
我的目標是使優化的最終版本獨立和大小(只有從庫中使用的必要符號),也在鏈接我提供我沒有看到MinGw
提到,我沒有nmake
(並不想得到它)。
請注意,MinGW工具目前無法清除掉目標文件中未使用的部分,請參閱[此錯誤報告](https://sourceware.org/bugzilla/show_bug.cgi?id=11539)。儘管將靜態鏈接和剝離大部分內容仍應該是可能的。 – rubenvb
我也建議你嘗試一下[MSYS2](http://msys2.github.io/)和它的qt5-static包,它提供了一個可立即使用的靜態構建的Qt,爲您節省了構建所有的麻煩。 – rubenvb
@rubenvb我嘗試避免非官方發佈,因爲它總是伴隨兼容性問題或項目放棄。 – Guest547