Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: [URGENT]Can't run .exe outside QT5

  1. #21
    Join Date
    Jan 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: [URGENT]Can't run .exe outside QT5

    Quote Originally Posted by alrawab View Post
    to be used by multiple people.... you have to include the run time dependencies or build a static app
    add this line to your .pro
    I added the line you said. My .pro is now:

    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2012-12-28T05:07:27
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8. CONFIG += static
    9.  
    10. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    11.  
    12. TARGET = GraphIt
    13. TEMPLATE = app
    14.  
    15.  
    16. SOURCES += main.cpp\
    17. mainwindow.cpp \
    18. about.cpp \
    19. graph.cpp \
    20. fullgraph.cpp
    21.  
    22. HEADERS += mainwindow.h \
    23. about.h \
    24. graph.h \
    25. fullgraph.h
    26.  
    27. FORMS += mainwindow.ui \
    28. about.ui \
    29. graph.ui \
    30. fullgraph.ui
    To copy to clipboard, switch view to plain text mode 

    It still asked me for the .dll upon opening

  2. #22
    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: [URGENT]Can't run .exe outside QT5

    Quote Originally Posted by bshikari View Post
    since i'm programming an application to be used by multiple people, not all of them with Qt installed. It would be preferable that it was a standalone .exe. but it's critical that it works on all computers
    If you want a static build of the application then you need to build Qt statically and have static versions of all Qt's dependencies. I'd advise against that if you don't feel comfortable with controlling the linker. I suggest you try to fix your dynamic deployment instead. If you have a 32bit build of Qt then you need 32bit msvc runtime. You can start by dumping all dlls from your Qt installation's bin directory into the same directory your exe sits in and see if it works. If yes then you can start eliminating libraries your application doesn't use. If not then it's likely that the problem is unrelated to dynamic linking.

    Do not modify any system paths and do not copy anything else anywhere and do not modify your project file in any way.
    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.


Tags for this Thread

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.