URGENT! How to run exe made of Qt on a computer without Qt software



  • Hi,

    I have a program, written on VC2012, with GUI made through Qt Designer. On my computer, the .exe works fine, with some dll files asked at the beginning.

    But when I try to run the .exe on another computer without VC2012, neither Qt software. It doesn't work. Even if I add all files of folder "bin" of Qt, the GUI still cannot open. How can I make it work? I hope there is a fast solution. (like MSVC has some "redistributable" packs to install dll files) I have checked online, there is no clear information about it.

    Could anyone please help me? Thanks in advance.



  • which version of Qt you use?
    if Qt5.0.2+,you should pack
    |All needed dll
    |qt.conf in the same path of your exe
    |platforms(folder)
    |qwindows.dll

    if use static build,only need a standalone exe



  • Hi, thanks for the reply. I use Qt 5.0.2.

    "All needed dll": do you mean all dll files in Qt/ msvc2012_64/bin?
    "platforms(folder)": which one? in Qt installed folder there are at least two "platforms".

    How to make a standalone exe? Do I need some special methods? (static build?) This one seems much better to use... Thanks!



  • not all,just your exe needed,you can run you exe in another computer to test,some dll is needed for every Qt-exe below:
    Qt5Gui.dll
    Qt5Core.dll

    .....test it yourself.

    qt.conf /you can new a file named it,if you don't use some settings,leave it empty/
    plugins /a folder/
    platforms /a folder inside plugins/
    qwindows.dll /a dll inside platforms/



  • Thanks. I found them all. It works on the machine with no Qt stuff.

    However, originally I set a background image in my GUI, this time it works but without the image (becomes very ugly :( ). Do you know how to fix it, please?

    By the way, how can I pack all these thing in one exe, instead of have all those files to take? Thanks!



  • if you set the image path in local path(such as ./images/demo.png),then you should pack the images folder to corresponding path.if you use a qrc(qt resource file),then the all the image will pack into the exe,and reference path is(:/prefix/demo.png,google for qt resource file),so you needn't to pack the images.
    if other trouble,such as you use jpeg image,you should pack qt jpeg support plugin.
    if another case,please check your code.

    if you want to pack a standalone exe,you should build static Qt libs yourself,they are too big to share.google for static build qt for vs 2010.



  • OK, thanks. I will check them all... :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.