2012-11-12 24 views
2

錯誤:QT5建立與MinGW的,建立錯誤_MCW_EM不是在這個範圍內聲明

..\..\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 64位專業版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 (x86)\Programming\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\Core-Static; 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,使

任何幫助如何解決這個將不勝感激!

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: cannot find -lQt5Cored0 collect2.exe: error: ld returned 1 exit status

+0

那麼,你是否設法編譯? –

回答

0

c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lQt5Cored0

那是由於Qt的源代碼本身的錯誤,因爲開發者在MSVS上測試了它,所以ug潛入了G​​it repo,但是沒有意識到MinGW的行爲不同。現在已經修復了(順便說一句,因爲我的確使用VS2012命令提示符來編譯Qt5)。所以如果你從Git獲取最新的代碼,它會正常工作。