Important: Please read the Qt Code of Conduct -

Building Qt5 with minGW - error [Solved]

  • the error:

    @....\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":

    Environment variables:

    bq. 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

    Old Environment variables:

    bq. 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

    Configure options I use (configuration seems to work fine, no errors):

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

    make command (dah): mingw32-make

    any help to how to resolve this will be much grateful!

    edit1: I did some more research and it's seems to be something related to OpenGL, but nothing on how to resolve this.

    edit2: I configure with -no-opengl and run mingw32-make, got the same error so, need more ides here.

    edit 3: if I change this line

    _control87(oldbits, _MCW_EM|_MCW_DN|_MCW_RC);

    in qlocale_tools.cpp to

    _control87(oldbits, MCW_EM);

    it's run until I get this error:

    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

  • Moderators

    [quote]> c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lQt5Cored0[/quote]
    That was due to a bug in Qt's source code itself. It has been fixed now; fetch the latest code from Git

  • Damm! I was trying so many times to build Qt5 with mingw-builds and failed. By the way I have succeed doing so with VS2012 command prompt, but since I didn't like all the include changes, and I'm working with a shared project with someone who have Qt4.8.x, I have decided to build Qt4.8.x and QtCreator with mingw-builds which worked great (a 64bit build).
    Nevertheless thanks a lots, when I finish working on the shared project I will try to build Qt5 again.

  • Moderators

    Yeah, the bug sneaked into the Git repo because the developer tested it on MSVS, but didn't realize that MinGW behaved differently.

    The include changes were to make it easier to manage Qt, and easier to introduce new features.

    Good luck with your shared project, and with testing Qt 5 in the future!

Log in to reply