首页 文章

Qt5构建时出现mingw-builds错误_MCW_EM未在此范围内声明

提问于
浏览
2

错误:

..\..\corelib\tools\qlocale_tools.cpp: In function 'char* qdtoa(double, int, int
, int*, int*, char**, char**)':
..\..\corelib\tools\qlocale_tools.cpp:2257:25: error: '_MCW_EM' was not declared
 in this scope
..\..\corelib\tools\qlocale_tools.cpp:2257:33: error: '_MCW_DN' was not declared
 in this scope
..\..\corelib\tools\qlocale_tools.cpp:2257:41: error: '_MCW_RC' was not declared
 in this scope
Makefile.Release:5718: recipe for target 'tmp/obj/release_shared/qlocale_tools.o
' failed
mingw32-make[5]: *** [tmp/obj/release_shared/qlocale_tools.o] Error 1
mingw32-make[5]: Leaving directory 'C:/qt5/2012.11/qtbase/src/tools/bootstrap'
Makefile:33: recipe for target 'release' failed
mingw32-make[4]: *** [release] Error 2
mingw32-make[4]: Leaving directory 'C:/qt5/2012.11/qtbase/src/tools/bootstrap'
Makefile:41: recipe for target 'sub-tools-bootstrap-make_first' failed
mingw32-make[3]: *** [sub-tools-bootstrap-make_first] Error 2
mingw32-make[3]: Leaving directory 'C:/qt5/2012.11/qtbase/src/tools'
Makefile:50: recipe for target 'sub-tools-make_first' failed
mingw32-make[2]: *** [sub-tools-make_first] Error 2
mingw32-make[2]: Leaving directory 'C:/qt5/2012.11/qtbase/src'
Makefile:39: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: *** [sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'C:/qt5/2012.11/qtbase'
makefile:51: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2

信息:

windows 7 x64 pro sp1

MinGW version

Qt5 from git

环境变量:

C:\ Python33 ; C:\ Perl64 \ site \ bin; C:\ Perl64 \ bin; C:\ mingw \ bin; C:\ Program Files(x86)\ Programming \ Git \ cmd; C:\ Program Files (86)\程序\的Git \ BIN

旧环境变量:

C:\ Python33 ; C:\ Perl64 \ site \ bin; C:\ Perl64 \ bin; C:\ Program Files(x86)\ AMD APP \ bin \ x86_64; C:\ Program Files(x86)\ AMD APP \ bin \ x86;%SystemRoot%\ system32;%SystemRoot%;%SystemRoot%\ System32 \ Wbem;%SYSTEMROOT%\ System32 \ WindowsPowerShell \ v1.0 ; C:\ Program Files(x86)\ SystemTools \ ATI Technologies \ ATI.ACE \核心静电; C:\ Program Files(x86)\ Programming \ Java \ jre7 \ bin; C:\ Program Files(x86)\ Programming \ Windows Kits \ 8.0 \ Windows Performance Toolkit ; C:\ cygwin \ bin ; C:\ MinGW \ bin ; C:\ Program Files \ Microsoft \ Web Platform Installer ; C:\ Program Files(x86)\ Microsoft ASP.NET \ ASP.NET Web Pages \ v1.0 ; C:\ Program Files \ Microsoft SQL Server \ 110 \ Tools \ Binn ; C:\ Program Files \ Programming \ doxygen \ bin; C:\ Program Files(x86)\ Programming \ Git \ cmd; C:\ Program Files(x86)\ Programming \ Git \ bin

配置我使用的选项(配置似乎工作正常,没有错误):

-debug-and-release -opensource -confirm-license -opengl desktop -nomake demos -nomake examples -nomake tests

make命令(dah):mingw32-make

如何解决这个问题的任何帮助将不胜感激!

edit1:我做了一些更多的研究,它似乎与OpenGL有关,但没有关于如何解决这个问题 .

edit2:我用-no-opengl配置并运行mingw32-make,得到了同样的错误,这里需要更多的ide .

编辑3:如果我改变这一行

_control87(oldbits,_MCW_EM | _MCW_DN | _MCW_RC);

在qlocale_tools.cpp中

_control87(oldbits,MCW_EM);

它一直运行,直到我收到此错误:

c:/ mingw / bin /../ lib / gcc / x86_64-w64-mingw32 / 4.7.2 /../../../../ x86_64-w64-mingw32 / bin / ld.exe:不能find -lQt5Cored0 collect2.exe:错误:ld返回1退出状态

1 回答

  • 0

    c:/ mingw / bin /../ lib / gcc / x86_64-w64-mingw32 / 4.7.2 /../../../../ x86_64-w64-mingw32 / bin / ld.exe:不能找-lQt5Cored0

    这是由于Qt源代码本身的一个错误,该漏洞潜入Git仓库,因为开发人员在MSVS上测试了它,但没有意识到MinGW表现不同 . 现在已经修复了(BTW,因为我确实设法用VS2012命令提示符编译Qt5);所以,如果你从Git获取最新的代码,它将工作正常 .

相关问题