Results 1 to 9 of 9

Thread: Multiple platforms

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    17
    Thanked 90 Times in 88 Posts

    Default Re: Multiple platforms

    At least for the linux part I would suggest www.virtualbox instead of dualbooting. You can download fully configured linux machines, so that you don't even have to install it yourself.

    I just googled "virtualbox MacOSX" and came up with this forum: http://forums.virtualbox.org/viewtopic.php?t=2076 . It may be a starting point. Although the legal aspects have to be thoroughly considered!

    To get back to the question: You would then install QtCreator on those platforms and compile your projects natively. So you avoid the problem of cross-compiling.

    Johannes

  2. #2
    Join Date
    Jan 2010
    Posts
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multiple platforms

    Thanks for the replies everyone -- so I understand now that I cannot cross-compile my projects. However, is there a way to easily transfer a project written in Windows to Linux (e.g., write the project in Windows, transfer, and compile the same project in Linux)?

    Thanks again for the support

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

    Default Re: Multiple platforms

    there is no easy way. there is only one way. just copy your whole source dir to linux machine and compile. If you dont have windows specific code like hardcoded paths ("C:\Windows", type) and win32 api calls then you are done.

  4. #4
    Join Date
    Jan 2010
    Posts
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multiple platforms

    Ok - we tried this but got an error. I'll post the error message next time I'm at the workstation. Thanks

  5. #5
    Join Date
    Oct 2009
    Posts
    364
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    10
    Thanked 37 Times in 36 Posts

    Default Re: Multiple platforms

    assuming you took some care to use portable code, i.e. use Qt API everywhere to hide platform specific code or #ifdef, the process is simple.
    An example to copy a project from windows to linux:
    1) delete debug/release folders
    2) delete Makefile, Makefile.Debug, Makefile.Release
    3) delete object_script*.*
    4) delete <project>.pro.user
    5) copy the entire folder
    6) open the <project>.pro file with Qt Creator on linux
    7) build all

    note: if you link any 3rd party libs, then you need to specify the differences in your .pro file like so (example):
    unix:LIBS += -l/location/of/lib/linux/libwhatever.a
    win32:LIBS += c:/location/of/lib/win/libwhatever.a

Similar Threads

  1. How to unify the QT style in different platforms?
    By yangyunzhao in forum Qt Programming
    Replies: 7
    Last Post: 5th August 2009, 12:23
  2. Compile binaries for all platforms from windows
    By aleksjej in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2009, 13:34
  3. send OS signals to apps on all platforms
    By Morea in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2008, 23:00
  4. What platforms are you using Qt on?
    By gfunk in forum Qt Programming
    Replies: 7
    Last Post: 8th February 2007, 16:47
  5. Compiling on different platforms
    By Tori in forum Newbie
    Replies: 1
    Last Post: 25th January 2006, 23:09

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.