Results 1 to 10 of 10

Thread: Cross compiling Qt 4 apps for linux

  1. #1
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Cross compiling Qt 4 apps for linux

    Hi
    I have a cross compiler for linux on windows.how can i use it to cross compile a Qt 4 app for linux?
    thanks
    Last edited by Dante; 7th May 2009 at 14:38.
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Cross compiling Qt 4 apps for linux

    Quote Originally Posted by Dante View Post
    I have a cross compiler for linux on windows.how can i use it to cross compile a Qt 4 app for linux?
    Well let me answer with another question:

    I have a cat. Is she black or withe?

    ...maybe it would be helpful if you tell us which compiler do you have! And a general answer: use qmake with the corresponding SPEC and then simply compile.

  3. #3
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cross compiling Qt 4 apps for linux

    Ok,Excuse me
    It is the g++-linux for cygwin 2.5
    And what is SPEC and how can i do the thing you mentioned?
    thanks again
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Cross compiling Qt 4 apps for linux

    when qmake generates the make files it has to know for what plattform it should be done, so use QMAKESPEC or the -spec flag to set your environment: linux-***. then normaly run make under cygwin and all should be done.

  5. #5
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cross compiling Qt 4 apps for linux

    I entered commands below in my project directory:
    qmake -project
    qmake -spec linux-g++ calc++.pro
    then inside the cygwin shell ,in the project directory,I entered the make command but it answered:
    Makefile:104: *** multiple target patterns. Stop.
    what should i do?
    And I thought I should use a cross-compiler like cygwins g++-linux.
    And could you explain about the OS modes in qmake?
    thanks
    Last edited by Dante; 8th May 2009 at 12:53.
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  6. #6
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cross compiling Qt 4 apps for linux

    You know.I really need the answer of this question.thanks again
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  7. #7
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cross compiling Qt 4 apps for linux

    i think a cross-compiler is one which compiles for a particular target machine/architecture, not the host machine.. what is the target for your cross compiler

  8. #8
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cross compiling Qt 4 apps for linux

    Its Linux and my goal is exactly compiling for a target OS.
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  9. #9
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,677
    Thanks
    13
    Thanked 1,596 Times in 1,524 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Cross compiling Qt 4 apps for linux

    I'm going to ask the dumb question here: Leaving Qt aside for the moment, have you been able to cross-compile a simple Hello World application on Windows for Linux?

    With your last Makefile error you could try looking at the output of
    Qt Code:
    1. make -n
    To copy to clipboard, switch view to plain text mode 
    to see what it is actually trying to do.

  10. #10
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cross compiling Qt 4 apps for linux

    It gives the same error with the difference that it prints 66 instead of 104 and it is the same with make itself,too.
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

Similar Threads

  1. cross compiling
    By tommy in forum Installation and Deployment
    Replies: 1
    Last Post: 8th March 2009, 19:02
  2. Cross compiling setup for all platforms
    By oc2k1 in forum Installation and Deployment
    Replies: 0
    Last Post: 5th February 2008, 14:42
  3. Replies: 1
    Last Post: 19th January 2007, 12:27
  4. Cross compiling QT3 on Linux, for win32
    By mjrich in forum Installation and Deployment
    Replies: 10
    Last Post: 6th March 2006, 19: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.