Results 1 to 6 of 6

Thread: Cross Compiling from windows to Mac and Linux

  1. #1
    Join Date
    Feb 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Windows

    Question Cross Compiling from windows to Mac and Linux

    Hey All,

    We work on a project, untill now almost everything is written in QT4.7.1/C++
    So it should work on all platforms where qt nomally should work. For so far I know we don't use any windows special ingredients. We try to keep it cross platform overall.

    I'm not the developer but i was hoping to get some information so i know how we can continue. (because the developer does not have any experience with Mac OS X)

    We are developing in VS2008 on windows. I know how to build a windows version. But how can we build a Mac OS X version? We did have to "make" qt from source to work with vs2008 on windows.

    I have a MAC available to test on, but prefer not to install any software on it (it's my sisters) So i was hoping we could build - cross compile - create the Mac OS X version on the windows machine and only test on these machines. Also i could try to make a vmware Mac OS test environment.

    Also how about windows redistributible?
    If we want to run our Release application on a fresh windows machine we have to install vs2008 redistributables. I can't find any any information about this for the Mac OS? (And perhaps we want to build a linux version later on...)


    Overview:
    -How to cross compile? (especially for Mac)
    -redistributables on the Mac OS?

  2. #2
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Cross Compiling from windows to Mac and Linux

    Oh..seriously?
    So in order to make an app. cross it has to be re-complied on each platform?
    I thought you compile it once and use it at any OS...

  3. #3
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Cross Compiling from windows to Mac and Linux

    For getting an impression what it means to set up a cross development environment you may look at http://silmor.de/39. This is a series of 3 articles describing step by step a cross compiler environment running under linux and generating code for windows. It's not exactly what you want, but it may give you some idea of the steps you need to take.

    When you are going to set up a virtual machine for testing, why don't you set up one for compiling too? I could imagine this is less effort than creating and validating a self built cross environment.

  4. #4
    Join Date
    Feb 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross Compiling from windows to Mac and Linux

    Ok so the easiest would be to just create the Mac OS x version right on the Windows VMWare environment with a IDE and QT on that Mac/VWMare... ?

  5. #5
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Cross Compiling from windows to Mac and Linux

    I haven't done it myself. But in case I had to work for Mac and could not get access to Mac hardware, that would be the way to go.
    You can get free gcc compiler for MAC (just Google for it) and Qt Mac download contains QtCreator according Nokia WEB site, so you automatically get an IDE.

    If you are working on a commercial project, you should also estimate the time needed to set up a Mac environment in a virtual machine and compare it to the cost of Mac hardware. Maybe you can convince your employer buying a Mac.

  6. #6
    Join Date
    Feb 2011
    Posts
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross Compiling from windows to Mac and Linux

    I just googled some around and this last forum question answered it well:
    http://stackoverflow.com/questions/4...opment-with-qt


    I quote:

    Qt's tagline is:

    Write once, compile everywhere.

    With this in mind, Qt doesn't officially offer any out of the box solution for cross compiling Qt applications from a specific platform to other different platforms. Though definitely do-able, if much work and time is invested, Qt good common practice would suggest you to build your Qt application directly on the targeted platform. That means, build your the Windows target for your application an a Windows machine, your Mac target on a Mac machine and Linux target on a, you guessed right( :-) ), a Linux machine.

    That's way "Write once, compile everywhere", in my opinion is a very well chosen combination of words. Otherwise the tag line might have been, "Write once, compile for everything".

    Going back to the original issue, you don't even need different physical machines for each of the targeted platforms, since in this day and age of good Virtualization solutions you can easily set up a couple of virtual machines and build you app on different platforms from the same physical machine.
    and

    Bottom line--do what you indicated. Get your source on each target platform and compile it there.

Similar Threads

  1. Replies: 3
    Last Post: 18th December 2010, 17:22
  2. Cross compiling Qt 4 apps for linux
    By Dante in forum Qt Programming
    Replies: 9
    Last Post: 13th May 2009, 13:33
  3. Cross-Compiling Linux to Windows
    By xgoan in forum Qt Programming
    Replies: 10
    Last Post: 5th July 2007, 20:44
  4. Cross compiling QT3 on Linux, for win32
    By mjrich in forum Installation and Deployment
    Replies: 10
    Last Post: 6th March 2006, 18:58

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.