当我试图以获得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