Results 1 to 8 of 8

Thread: Is it possible to use MinGW compiler in Visual Studio

  1. #1
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Is it possible to use MinGW compiler in Visual Studio

    I have Visual Studio 2005, but I want to compile code that uses libraries available only in Unix. The native VS compiler can’t compile it and only MinGW can translate the code so it works on Windows. Is it possible to change the compiler in Visual Studio so it uses MinGW?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    Yes, it's possible. Either reconfigure Visual Studio to do a custom build or simply change the QMAKESPEC to win32-g++ (or something like that) and use qmake to generate a VS project (pass -tp vc option to qmake).

  3. #3
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    Thank you for your help, but it doesn't work yet.

    I get this warnings/errors when I use use qmake to generate a VS project (pass -tp vc option to qmake) with QMAKESPEC set to win32-g++:
    WARNING: Unable to generate output for: C:/SVN/[...]/Makefile.Debug [TE
    MPLATE vcapp]
    WARNING: Unable to generate output for: C:/SVN/[...]/Makefile.Release [
    TEMPLATE vcapp]

    and it doesn't make the .vcproj file

    N.B. It works well if I let QMAKESPEC set to win32-msvc2005 but it's not what I am looking for.
    Last edited by Dauntless; 24th March 2007 at 01:19.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    So maybe you can't have a vs project generated by QMake. In that case you have to use QMake directly (without generating the VS project) - create a custom build that simply calls qmake and mingw-make.

  5. #5
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    I tried doing that but I lose the debugging information for my program. I get a "binary was not build with debug information" error, and without the powerful debugging tool that VS has, I think I will go back to QDevelop where at least I have one.

    Here's an article about custom builds that some might find interesting if they use VS.

    N.B. I did make the debug (not the release) version of my program with mingw32-g++.
    Last edited by Dauntless; 24th March 2007 at 11:04.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    For debugging you can compile with MSVC. I don't think Visual Studio can debug MinGW compiled binaries.

  7. #7
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    MSVC can't compile parts of my code because I use C POSIX libraries. I know, I have to translate the code myself so it will use win32 api but it is a lot of work and I was thinking if it was possible to change just the compiler so I would use minGW, which does that job for me. Well, anyhow, thanks for your time wysota, I guess I'll stick with QDevelop for now...

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it possible to use MinGW compiler in Visual Studio

    You mean that MSVC has trouble compiling those posix libraries? MSVC has come a long way - it shouldn't have trouble with C code...

Similar Threads

  1. Visual Studio App Wizard for Qt
    By joshlareau in forum Qt-based Software
    Replies: 4
    Last Post: 9th February 2007, 20:36
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  3. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  4. Qt Designer & Visual Studio 2005
    By pSiCho in forum Qt Tools
    Replies: 6
    Last Post: 9th February 2006, 13:40
  5. Where does VS save its inviornment vars?
    By high_flyer in forum Installation and Deployment
    Replies: 5
    Last Post: 4th February 2006, 10:10

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.