Results 1 to 11 of 11

Thread: how to get executable of a Qt project inorder to run it different machine?

  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default how to get executable of a Qt project inorder to run it different machine?

    I developed a Qt project in my computer(windows OS), now i want to execute this project in my friends machine, that machine doesn't have Qt installed...
    What are the steps i need to proceed, to get executable of my project, which must execute in different machine...?

  2. #2
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    when you try to run your application in the computer that doesnt have Qt you need to include the .DLL`s necessary to execute. If you try to run it you ll recieve error messages telling you what libraries you need to include. Most common are:

    1. mingwm10.dll
    2. QtCore4.dll
    3. libgcc_s_dw2-1.dll
    4. QtGui4.dll

    And if you connect to a database include a folder named sqldrivers with the DLL you use. You`ll find those libs in the Qt SKD folder (where you installled Qt)

    Hope it helps!

  3. #3
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    2

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    If you need more information. A good search option "Static compile Qt", but since Qt is available to multiple platforms, each platform will be able to compile it himself ..

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    Read: Deploying Qt Applications and the numerous time this exact question has been asked here.

    My recommendation is that you use dynamic libraries unless you <i>must</i> have a static executable. The level of effort involved in producing a static executable, including all your dependencies, is comparable to writing an installer script for NSIS or another similar tool. A wholly static executable is complicated greatly if you use QTHelp, QtWebkit or Phonon which impose LGPL requirements for end-user relinking (even on commercial licence holders).

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

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    ... and you can't use plugins with static linking.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    Quote Originally Posted by wysota View Post
    ... and you can't use plugins with static linking.
    true that :P

    jajaja

  7. #7
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    Quote Originally Posted by KillGabio View Post
    when you try to run your application in the computer that doesnt have Qt you need to include the .DLL`s necessary to execute. If you try to run it you ll recieve error messages telling you what libraries you need to include. Most common are:

    1. mingwm10.dll
    2. QtCore4.dll
    3. libgcc_s_dw2-1.dll
    4. QtGui4.dll

    And if you connect to a database include a folder named sqldrivers with the DLL you use. You`ll find those libs in the Qt SKD folder (where you installled Qt)

    Hope it helps!

    Thank u i got error message saying....
    "The procedure entry point _Z5qFreePv could not be linked in the dynanic link library QtCore4.dll" !!!

  8. #8
    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: how to get executable of a Qt project inorder to run it different machine?

    Do you use gcc or MSVC? And have you build the executable in release mode?

  9. #9
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    Quote Originally Posted by Lykurg View Post
    Do you use gcc or MSVC? And have you build the executable in release mode?
    I'm using GCC.
    Ya i built the executable in release mode...

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

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    It's likely you took the wrong QtCore4.dll. Take the one under "qt" subdirectory of your QtSDK installation. The same goes for the rest of libraries.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to get executable of a Qt project inorder to run it different machine?

    Dependency walker is your friend.
    Just run it on target box and load the executable, it will tell you exacly what's missing.

Similar Threads

  1. how set icon for qt executable project file with cmake and vs 2005?
    By banlinhtienphong in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2011, 08:38
  2. How to make my Qt project executable
    By mebingj in forum Installation and Deployment
    Replies: 1
    Last Post: 14th March 2011, 13:23
  3. Replies: 4
    Last Post: 2nd July 2010, 21:16
  4. How do I make my project executable file
    By theios_nikos in forum Newbie
    Replies: 8
    Last Post: 4th June 2010, 20:48
  5. Replies: 2
    Last Post: 22nd December 2009, 20:52

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.