Results 1 to 4 of 4

Thread: Cross-compiler Qt4 app from ubuntu to windows xp

  1. #1
    Join Date
    Oct 2009
    Posts
    12

    Default Cross-compiler Qt4 app from ubuntu to windows xp

    Hi everybody

    I am working with qt4 under ubuntu. I have developed one application for control of a specific digital camera and a hardware device for control of piezo-actuators. The application is working well under ubuntu. My question is: Is it possible to make something like exe file under ubuntu that I could use under Windows XP? I will install all drivers needed for my specific hardware but I am not sure if this will work.

    I tried the following example from http://stackoverflow.com/questions/1...nux-to-windows.
    I wrote the following code in ubuntu terminal:

    sudo apt-get install mingw32
    cat > main.c <<EOF
    int main()
    {
    printf("Hello, World!");
    }
    EOF
    i586-mingw32msvc-cc main.c -o hello

    The result was that I have installed mingw32 and finally I have created main.c main.o and hello files.
    I am new in this and I don't understand how to proceed further.

    I don't understand the line below:
    Replacing apt-get for yum, or whatever your Linux distro uses. That will generate a hello.exe for Windows.

    What I have to write in the terminal and where I have to replace apt-get?

    Also where I have to set CC=i586-mingw32msvc-cc and where to write this code:
    CC=i586-mingw32msvc-cc ./configure && make

    Finally I would like to work under ubuntu making executable files that could work under Windows for specific control hardware using their specific .dll libraries and drivers.

    Thank you in advance

    Best regards

  2. #2
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Cross-compiler Qt4 app from ubuntu to windows xp

    Link is broken.

    Replacing apt-get for yum, or whatever your Linux distro uses.
    yum is package manager for Fedora, so you don't need it.

    CC=i586-mingw32msvc-cc ./configure && make
    This should be run in terminal to build autotools-based project.

    The simplest way will be to build Qt Libraries with MinGW in Linux (maybe prebuilt package will also work) and then configure Qt Creator to use this toolchain. AFAIR, there were some problems with default mingw32 and Qt, so we used MinGW-w64.
    Oleg Shparber

  3. #3
    Join Date
    Oct 2009
    Posts
    12

    Default Re: Cross-compiler Qt4 app from ubuntu to windows xp

    Thank you for your answer.

    When I write this code:
    CC=i586-mingw32msvc-cc ./configure && make
    I've receive the following error:
    bash: ./configure: No such file or directory

    May be I have to be in root directory not in the directory where is the main.c file.
    Please help me!!!

  4. #4
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Cross-compiler Qt4 app from ubuntu to windows xp

    This command configures and builds something You should build your qt project using mingw compiler. And I am not sure that prebuilt Qt libs will work with cross-compiler.
    Last edited by Oleg; 1st December 2011 at 17:57.
    Oleg Shparber

Similar Threads

  1. change compiler for cross compiling
    By Mr Bean in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th February 2011, 13:35
  2. Cross compiling Qt X11/Win/Arm on Ubuntu 64 bit
    By chombium in forum Installation and Deployment
    Replies: 0
    Last Post: 23rd January 2011, 01:09
  3. problems with making cross compiler
    By nataly in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 15th December 2009, 06:44
  4. Qt Embedded cross compiler make fails
    By quado player in forum Installation and Deployment
    Replies: 0
    Last Post: 1st September 2009, 14:22
  5. Cross compiler in Linux
    By vincat in forum Qt Programming
    Replies: 1
    Last Post: 11th June 2009, 07:14

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
  •  
Qt is a trademark of The Qt Company.