Results 1 to 18 of 18

Thread: How to configure Qt to work with MinGW-64?

  1. #1
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to configure Qt to work with MinGW-64?

    I'd like to use Qt with MinGW 64. I read the following links but I've got some questions
    Installing Qt/Windows
    configure Options (Qt)

    What do I need to do to configure Qt? I think I need to do 'configure -platform ...', but don't know what exactly to put there.

    My MinGW-64 download has g++ and gcc commands, but didn't come with any 'make' command. How should I build with it? Is the lack of a 'make' command a problem? [edit: I was directed to just use mingw32-make, which should work]

    Also I've set my PATH environment variable to include the mingw-64\bin folder, and it works from normal cmd command prompt, but the path isn't recognized Qt command prompt. I have to manually set PATH= inside the Qt prompt. How do I have the Qt command prompt initialize with the mingw-64\bin path as well as qt\bin?
    Last edited by Skywalker; 8th July 2009 at 03:15.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    try to put win32-g++..
    as for the make ... you can create a batch file make.bat which calls mingw-make or something..

    what do you mean by qt command prompt? the qt sources do not come with a command prompt.. so it should work

  3. #3
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    'configure -platform win32-g++' starts, but gives me the error:
    make (e=2): The system cannot find the file specified.
    mingw32-make: *** [project.o] Error 2
    Building qmake failed, return code 2
    By command prompt I mean the Qt command prompt which sets up the MinGW/Qt environment.

  4. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    are u using qt sdk or qt library source?
    sdk wont work.. use source

  5. #5
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    Quote Originally Posted by Skywalker View Post
    By command prompt I mean the Qt command prompt which sets up the MinGW/Qt environment.
    ya i ment the same... its just a batch file which calls cmd.exe... but this file only comes with a sdk and not with source.

  6. #6
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    Quote Originally Posted by MrDeath View Post
    are u using qt sdk or qt library source?
    sdk wont work.. use source
    I'm using SDK v2009.03. I'm on Windows - Vista 64. I'm afraid I'm not even sure where to get source Didn't see a link on the download page.

  7. #7
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

  8. #8
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    Thanks. I'd actually prefer to use the SDK, though I'd be willing to try just the source. However I actually see that qtenv.bat, "win32-g++" is already the QMAKESPEC. What I'd like is to change it to mingw-w64 (mingw-w64\bin\mingw32-make.exe is the make command on my computer, mingw-w64\bin\x86_64-w64-mingw32-g++.exe and C:\mingw-w64\bin\x86_64-w64-mingw32-gcc.exe are the compilers).

    I tried editing qtenv.bat to "set QMAKESPEC=x86_64-w64-mingw32" and "set QMAKESPEC=c:\mingw-w64\bin\x86_64-w64-mingw32" but the programs being compiled were still using the 32 bit compiler.

    "configure -platform c:\mingw-w64\bin\x86_64-w64-mingw32-g++" and "configure -platform x86_64-w64-mingw32-g++" both give me "Invalid option "c:\mingw-w64\bin\x86_64-w64-mingw32-g++" for -platform." type errors.

    Should I uninstall the SDK and try to run configure again with the source, and/or is there something else I should be using other than x86_64-w64-mingw32?

  9. #9
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    Alternatively, is there a temporary modification I can make to the Makefile to have it build with MinGW-64? I need to be getting some work done

  10. #10
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    try everything you mentioned with source only... the sdk comes precompiled and QtCreator etc are dependent on it.. if you configure it again .. they will break... we have seen a lot of ppl having problems with sdk when they try to change it (for example use it with msvc).
    Theotrically SDKs are standalone products and they should not be changed.

    so first try win32-g++ with Qt source and make sure that no mingw(32bit) compiler is present on your machine.

  11. #11
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    I uninstalled the SDK and installed 4.5.2. During installation I pointed it to the location of MinGW 64 though it said it couldn't locate g++, I guess because it was looking for the 32 bit filename. Renaming the file might be an option there anyway.

    I ran 'configure -platform win32-g++' but I'm getting the same error as with the SDK.

    "make (e=2): The system cannot find the file specified.
    mingw32-make: *** [project.o] Error 2
    Building qmake failed, return code 2"

    Also when I try to launch Assistant, Demos, etc. I get the error "mingwm10.dll was not found". I searched in the mingw-w64 folder and there's no such DLL, the only DLLs are libgcc_s_sjlj-1.dll, lissp-0.dll, and libssp.dll.a.

  12. #12
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    Quote Originally Posted by Skywalker View Post
    I uninstalled the SDK and installed 4.5.2. During installation I pointed it to the location of MinGW 64
    are you sure you are using the sources? did you downloaded the 4.5.2 exe file? if yes then download the source here

    http://get.qtsoftware.com/qt/source/...-src-4.5.2.zip

  13. The following user says thank you to nish for this useful post:

    Skywalker (9th July 2009)

  14. #13
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    Whoops you're - I read the wrong post in the thread you directed me to - saw the one about "right column", missed your post with the link.

    I actually got the same error as before however. This time it occurred to me to copy 'x86_64-w64-mingw32-g++.exe' to 'g++.exe', and surprisingly that actually seems to have worked in bypassing that particular error. Must have been the problem since the start.

    After I uninstalled 4.5.2, I unzipped and ran 'configure -platform win32-g++'. It ran for a while but fails with the error message:
    C:\Qt/src/corelib/tools/qdatetime.cpp: In function 'void localToUtc(QDate&, QTim
    e&, int)':
    C:\Qt/src/corelib/tools/qdatetime.cpp:3768:12: error: '_tzset' was not declared
    in this scope
    C:\Qt/src/corelib/tools/qdatetime.cpp: In member function 'QString QDateTimePars
    er::sectionText(const QString&, int, int) const':
    C:\Qt/src/corelib/tools/qdatetime.cpp:4424:10: warning: case label value is less
    than minimum value for type
    C:\Qt/src/corelib/tools/qdatetime.cpp:4425:10: warning: case label value is less
    than minimum value for type
    C:\Qt/src/corelib/tools/qdatetime.cpp:4426:10: warning: case label value is less
    than minimum value for type
    C:\Qt/src/corelib/tools/qdatetime.cpp: In member function 'QString QDateTimePars
    er::sectionText(int) const':
    C:\Qt/src/corelib/tools/qdatetime.cpp:4438:10: warning: case label value is less
    than minimum value for type
    C:\Qt/src/corelib/tools/qdatetime.cpp:4439:10: warning: case label value is less
    than minimum value for type
    C:\Qt/src/corelib/tools/qdatetime.cpp:4440:10: warning: case label value is less
    than minimum value for type
    mingw32-make: *** [qdatetime.o] Error 1
    Building qmake failed, return code 2

  15. #14
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    looks like only Mr. Wysota or Google can help you now.. I dont have 64machine.. cant test myselft sorry

  16. #15
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    OK - thanks for your help

  17. #16
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    I commented out the _tzset() line in qdatetime.cpp to see if that would help, but now I'm getting many new errors, now from qfsfileengine_win.cpp. They seem to be the same as for the person on this post to the mailing list.
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:112:123: warning: 'dllimport' attr
    ibute ignored
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:114:162: warning: 'dllimport' attr
    ibute ignored
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:122:56: warning: 'dllimport' attri
    bute ignored
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In static member function 'static
    void QFSFileEnginePrivate::resolveLibs()':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:177:99: warning: deprecated conver
    sion from string constant to 'WCHAR*'
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:181:98: warning: deprecated conver
    sion from string constant to 'WCHAR*'
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:184:101: warning: deprecated conve
    rsion from string constant to 'WCHAR*'
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'qint64 QFSFil
    eEnginePrivate::nativeSize() const':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:666:50: error: '_get_osfhandle' wa
    s not declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'int QFSFileEn
    ginePrivate::nativeHandle() const':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:903:33: error: '_fileno' was not d
    eclared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:913:60: error: '_open_osfhandle' w
    as not declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'bool QFSFileE
    nginePrivate::nativeIsSequential() const':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:934:57: error: '_fileno' was not d
    eclared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:934:58: error: '_get_osfhandle' wa
    s not declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'bool QFSFileE
    nginePrivate::doStat() const':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:1323:50: error: '_get_osfhandle' w
    as not declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'virtual bool
    QFSFileEngine::setPermissions(uint)':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:1918:4: error: '::_chmod' has not
    been declared
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'virtual bool
    QFSFileEngine::setSize(qint64)':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:1938:46: error: '_get_osfhandle' w
    as not declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'virtual QDate
    Time QFSFileEngine::fileTime(QAbstractFileEngine::FileT ime) const':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:2004:49: error: '_get_osfhandle' w
    as not declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp: In member function 'uchar* QFSFil
    eEnginePrivate::map(qint64, qint64, QFile::MemoryMapFlags)':
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:2056:53: error: '_fileno' was not
    declared in this scope
    C:\Qt\qt/src/corelib/io/qfsfileengine_win.cpp:2056:54: error: '_get_osfhandle' w
    as not declared in this scope
    mingw32-make: *** [qfsfileengine_win.o] Error 1
    Building qmake failed, return code 2

  18. #17
    Join Date
    Sep 2009
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Lightbulb Re: How to configure Qt to work with MinGW-64?

    Sorry for digging up an old thread, but this is one of the first hits on Google for "mingw64 Qt", and there is now a way to easily use Qt with that toolchain:

    https://sourceforge.net/apps/trac/mi...ing%20QT%204_6

    It comes down to this:
    - download the patched sources
    - download sezero's latest build of mingw64 (has almost all that you need)
    - if you want sse/sse2, appply the small patch described under the "Download" section of the above linked wiki.
    - configure, build and use like you would normally

    Just thought this is pretty vital info for anyone searching for an answer.

    PS: Mingw64 has a 32-bit and 64-bit toolchain, so you can build both versions with mingw64 (there are seperate downloads for win32 and win64 targets).

  19. #18
    Join Date
    Oct 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to configure Qt to work with MinGW-64?

    mingw-w64 wiki updated:
    How to build Qt with mingw-w64

Similar Threads

  1. A Guide to Install MinGW, Qt4 and Eclipse Integration on Windows XP
    By shiyutang in forum Installation and Deployment
    Replies: 10
    Last Post: 5th August 2009, 04:03
  2. Shadow build QT for the win32-g++ (MinGw) platform.
    By Avrohom in forum Installation and Deployment
    Replies: 0
    Last Post: 20th January 2009, 23:10
  3. Qt 4.4.0 + MinGW + MySQL installation problem
    By jambrek in forum Installation and Deployment
    Replies: 2
    Last Post: 1st December 2008, 11:02
  4. anyone building/deploying Qt+Coin3d+SoQt apps with MinGW??
    By vonCZ in forum Installation and Deployment
    Replies: 0
    Last Post: 13th November 2008, 15:59
  5. Qt + boost + MinGW on Windows
    By akos.maroy in forum Newbie
    Replies: 3
    Last Post: 12th June 2008, 14:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.