Results 1 to 5 of 5

Thread: How to make exe for windows using .pro project file in qt in linux machine ?

  1. #1

    Exclamation How to make exe for windows using .pro project file in qt in linux machine ?

    Hello,
    I am new to QT.
    I have developed QT GUI application on linux using QT 5.0 and i want to generate exe for windows using executable in QT 5.0.
    How to cross-compile.pro project file which is in linux in qt 5.0.2 for windows environment to work as a exe without any error ?

    Is there MinGW compiler do we need to detect it in linux machine using qt 5.0 ?

    Can you please guide me it is very urgent.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to make exe for windows using .pro project file in qt in linux machine ?

    If it is urgent then you are far better off finding a Windows machine, installing the Qt SDK on Windows, and building from source code there.

    The alternative is:
    • Build a MingW cross-compiler tool chain
    • Build any libraries, including Qt, your application needs using the cross compiler
    • Configure Qt, your IDE, and your project to use the cross compiler
    • Build your application using the cross compiler

    MXE (M cross environment) may help you do some of this.

    Then you still need a Windows machine to run and test it, which brings me back to my opening point.

  3. #3

    Default Re: How to make exe for windows using .pro project file in qt in linux machine ?

    Yes, so for that we need to either install QT SDK on windows machine and build source code from windows qt application.

    Another alternative, as you have suggested, I tried to install Mingw64 bit on linux machine and when in qt 5.0 when I tried to add "Compilers" tab in "Build and run" option
    in "/usr/lib64/ccache/x86_64-w64-mingw32-g++" and added Mingw there.

    But, when i tried to set "Kits" option as MIngw and set Compiler as "Mingw" and Qt version as "Qt 5.0.2 GCC 64 bit", but Mingw compiler does not detect in qt 5.0 in linux machine.
    Screenshot from 2013-05-03 10:41:22.jpg

    So, what i should do to resolve this( to detect Mingw compiler) in linux machine in qt 5.0?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to make exe for windows using .pro project file in qt in linux machine ?

    You need to build Qt with the MingW cross compiler and select that version of Qt. You cannot use the cross compiler with a set of Qt libraries built for your system's native environment.

    I'll say it again: If it is urgent then you are far better off finding a Windows machine, installing the Qt SDK on Windows, and building from source code there.

  5. #5
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: How to make exe for windows using .pro project file in qt in linux machine ?

    Run VirtualBox in Linux. And install Windows+QtSDK

Similar Threads

  1. How to make a Project runnable on Linux?
    By rastarockett in forum Newbie
    Replies: 3
    Last Post: 8th April 2013, 00:28
  2. Compiling a project from linux in windows
    By matulik in forum Qt Tools
    Replies: 2
    Last Post: 6th January 2013, 12:49
  3. Need to make my project file work on both Windows 7 and Mac 10.6
    By KenJustKen in forum Installation and Deployment
    Replies: 0
    Last Post: 14th March 2012, 22:53
  4. linux project made in windows
    By alimooghashang in forum Qt Programming
    Replies: 2
    Last Post: 26th August 2010, 06:46
  5. project file for 64 and 32 bit under linux
    By harakiri in forum Qt Programming
    Replies: 4
    Last Post: 19th July 2010, 19:01

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.