Results 1 to 7 of 7

Thread: Cross platform application???

  1. #1
    Join Date
    Dec 2006
    Posts
    103
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Cross platform application???

    hi,
    I think there are very few posts( or may be none) on this forum abt making cross platform applications.
    Can anyone enlighten me that how can we make a simple application( may be like hello world), cross platform( to be able to run on linux, if made on windows)?
    Do we need to install the same version of Qt on the system on which we want to run the exe made on other system? Like for example, i made a program of simply drawing lines and some 3d features which uses Qglwidget and all.now its successfully executing on my system. if i am trying to simply take tht exe on other system(where the Qt is not installed) and run tht then its giving error like Qtopengl4.dll or Qtgui4.dll is not found.
    so this means that we need to install Qt on the system where all we want to execute its exe?
    so now if its true then can anyone tell me that how can we make the exe independent of the platform and the fact tht Qt shd be installed to run its exe??
    please give the links from internet or documentaion of Qt if its there because i could not find the information which i need.

    thanks
    Last edited by Shuchi Agrawal; 14th February 2007 at 05:04. Reason: missing [code] tags
    I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
    now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.

  2. #2
    Join Date
    Jan 2007
    Posts
    209
    Thanks
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross platform application???

    You need to have Qt installed on the platform you want to support, and compile it there. You cannot compile under one platform and run it in another ever.

  3. The following user says thank you to VireX for this useful post:

    Shuchi Agrawal (14th February 2007)

  4. #3
    Join Date
    Dec 2006
    Posts
    103
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross platform application???

    Quote Originally Posted by VireX View Post
    You need to have Qt installed on the platform you want to support, and compile it there. You cannot compile under one platform and run it in another ever.
    ok but can i run without recompilation for same platform but different machines( like 2 different Pc with same configuration but one not installed with Qt) ?
    I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
    now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Cross platform application???

    Quote Originally Posted by Shuchi Agrawal View Post
    ok but can i run without recompilation for same platform but different machines( like 2 different Pc with same configuration but one not installed with Qt) ?
    Take a look at: Deploying Qt Applications
    An application written with Qt needs Qt libraries to run. You have basically two ways:
    • provide shared libs together with your application
    • link the libs statically into your application
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    Shuchi Agrawal (14th February 2007)

  7. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Cross platform application???

    Quote Originally Posted by VireX View Post
    You cannot compile under one platform and run it in another ever.
    Actually you can, this is called cross-compiling. But you'll still be able to run the program on the target platform and not on both.

    It's an obstacle you cannot overcome. Windows, Unix and MacOS use completely different concepts of a binary file, process, etc. so there is no way to have a single binary work on all three platforms. There is a possibility of having some kind of script which would run on all three platforms and that would have embedded binaries for all platforms and run the appropriate one. Of course this still leaves the problem on different hardware architectures on different platforms (i.e. PowerPC vs i386 vs ARM vs m68k vs...)

  8. #6
    Join Date
    Dec 2006
    Posts
    103
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross platform application???

    thanks a lot for this info. can you refer me some more technical details in some links about this and to what extent i can make my programs cross platform.
    i basically want to know that what all i need to do on a linux system to run a program which is coded and successfully executed on windows XP.
    I worked on windows Xp with Qt 4.2.2(Open Source Version) and MinGw
    now i am trying the same things on Fedora Core 5 (linux-gcc) and Qt 4.2.2 open source edition.

  9. #7
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Cross platform application???

    Quote Originally Posted by Shuchi Agrawal
    thanks a lot for this info. can you refer me some more technical details in some links about this and to what extent i can make my programs cross platform.
    You need to compile and link on your target platforms. The source code is cross platform, but you still need to build on all platforms. The included qmake utility will help you greatly. Please see the qmake documentation. It comes with Qt.

    If you are still having problems, I would greatly urge you to get the book "C++ GUI Programming with Qt 4". It will contain all the information you need.

  10. The following user says thank you to Brandybuck for this useful post:

    Shuchi Agrawal (15th February 2007)

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 18:51
  2. Cross Platform Logging
    By skyphyr in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2006, 16:32
  3. Cross compile QT/X11 for platform xscale-elf
    By nmkarvekar in forum Installation and Deployment
    Replies: 0
    Last Post: 19th May 2006, 07:20
  4. Using Qt to write Cross Platform Library
    By ball in forum Qt Programming
    Replies: 2
    Last Post: 3rd April 2006, 09:58
  5. Replies: 3
    Last Post: 31st March 2006, 18:38

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.