PDA

View Full Version : [URGENT]Can't run .exe outside QT5



bshikari
22nd January 2013, 17:10
I use Qt Creator 2.6.1 with Qt5.0.0 on Windows 7 64bits.

When I try to run the .exe file, after including the .dll's, the executable does absolutly nothing, not even starting a process.
I ran depency walker on the program and found out it was because of a conflit between the 64bit dll's in my computer and the 32bit dll on Qt5.

I then tried running the executable on a 32 bit pc, with windows vista 32bits and the same thing happened when trying to open my executable.
Running dependency walker I get the following message:

8611

How can i solve this in order to run the executable?

Thank You in advance

wysota
22nd January 2013, 18:19
What dependencies does dependency walker report as missing?

bshikari
22nd January 2013, 19:50
None, it display the error message "Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module." on IEFRAME.DLL, as seen in the image

wysota
22nd January 2013, 20:28
And there are no dependency problems lower in the tree?

bshikari
22nd January 2013, 20:43
Only those involving IEFRAME.DLL

wysota
22nd January 2013, 20:50
Can you verify if your application is starting at all? E.g. by running it from the console and printing some debug statement or by creating some file or something like that? Can you run it under a debugger?

bshikari
22nd January 2013, 22:06
I did as you said, and nothing, the application doesn't start.
If I run it inside Qt5 I get no error, even in the 64-bit computer, where I developed it, the program runs smoothly and performs all the tasks it is suposed to perform

wysota
22nd January 2013, 22:19
I did as you said, and nothing, the application doesn't start.
What exactly did you do?

bshikari
22nd January 2013, 22:36
[UPDATE] For some reason I can run the debug .exe, but not the realase .exe

ChrisW67
22nd January 2013, 22:49
So you have likely deployed the debug Qt libraries and plugins rather than the release libraries and plugins.

bshikari
11th February 2013, 17:55
What exactly did you do?

I inserted a cout in the beggining of the code, and it didn't print anything in the terminal, thus prooving the application didn't start


So you have likely deployed the debug Qt libraries and plugins rather than the release libraries and plugins.

I includes the release .dll's in the release version's folder (the ones not ended in d), which are the ones the .exe asks for if I try to run it and don't have them in the root folder. So I don't think that's the problem

omid_kma
11th February 2013, 20:12
You must put dll files from bin folder
Also add this to release folder : libEGL.dll

bshikari
11th February 2013, 22:39
You must put dll files from bin folder
Also add this to release folder : libEGL.dll

I included all the dll's (from Qt's bin folder) that the executable asked me too, as well as libEGL. That was what I did before. Same result. no reaction from the executable upon opening

wysota
11th February 2013, 22:42
Use Dependency Walker to find missing dependencies.

bshikari
11th February 2013, 22:54
Use Dependency Walker to find missing dependencies.

I did, check the original post. That was on a Windows Vista 32 bits.

On my Windows 7 64x I get all these conflits with 64x and 86x, but this only happens with the release version (all this is explained in the post and replys to this thread):

8706

Again, if you want more detail, please read the original post and replies

alrawab
11th February 2013, 23:09
add Qt5 bin dir which contains also runtime dll to environment path for example my Qt5 bin dir is :
C:\Qt\Qt5.0.0\5.0.0\msvc2010\bin
go to
1-Control Panel\All Control Panel Items\System
2-advanced system settings
3-enviroment variables
4-system variables
5-path ==>edit ==>add ; ==>past qt5 bin path at the end of line
8707

bshikari
11th February 2013, 23:16
add Qt5 bin dir which contains also runtime dll to environment path for example my Qt5 bin dir is :
C:\Qt\Qt5.0.0\5.0.0\msvc2010\bin
go to
1-Control Panel\All Control Panel Items\System
2-advanced system settings
3-enviroment variables
4-system variables
5-path ==>edit ==>add ; ==>past qt5 bin path at the end of line
8707

what name should I give this inclusion?

alrawab
11th February 2013, 23:23
this inclusion give you advantage to run qt executable on your machine without including Qt 5 dependencies .
if you decide to export your executable to a client before packaging by nsis try to use Dependency Walker
http://www.dependencywalker.com/

bshikari
12th February 2013, 00:00
this inclusion give you advantage to run qt executable on your machine without including Qt 5 dependencies .
if you decide to export your executable to a client before packaging by nsis try to use Dependency Walker
http://www.dependencywalker.com/

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

alrawab
12th February 2013, 00:06
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

CONFIG += static

bshikari
12th February 2013, 00:30
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:


#-------------------------------------------------
#
# Project created by QtCreator 2012-12-28T05:07:27
#
#-------------------------------------------------

QT += core gui
CONFIG += static

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = GraphIt
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp \
about.cpp \
graph.cpp \
fullgraph.cpp

HEADERS += mainwindow.h \
about.h \
graph.h \
fullgraph.h

FORMS += mainwindow.ui \
about.ui \
graph.ui \
fullgraph.ui


It still asked me for the .dll upon opening

wysota
12th February 2013, 00:41
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.