July 2, 2011

jk_mk jk_mk
Lab Rat
108 posts

problem in running the exe file

 

Hello to all,

I have created my application in the debug mode and runs without errors getting the right results. But when I am trying to run the created exe file I get a message saying that QtCored4.dll is missing from my pc. I am using windows 7 (64 bit), visual studio 2010 and Qt 4.7.3 added in vs2010. What I should do to run the exe file without using vs? Is it necessery to run my application in release mode, or I could do this task just with debug mode?

Thanks

12 replies

July 2, 2011

koahnig koahnig
Gene Splicer
2904 posts

Do you have the path with the dlls set in your environment?

July 2, 2011

jk_mk jk_mk
Lab Rat
108 posts

I have set E:\Qt\4.7.3 in my enviromental variables with name QTDIR

July 2, 2011

koahnig koahnig
Gene Splicer
2904 posts

You should set the bin directory also in your path variable. Then it should work.

July 2, 2011

Lukas Geyer Lukas Geyer
Lab Rat
2074 posts

All dependencies (DLLs), including the Qt libraries, have to be placed in one of these locations [goo.gl]

  • The directory where the executable module for the current process is located.
  • The current directory.
  • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
  • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
  • The directories listed in the PATH environment variable.

July 3, 2011

jk_mk jk_mk
Lab Rat
108 posts

Well I have run my application in release mode and I have set the bin directory in my path variable. So I have created the exe file, and I can run it without using the vs2010. But when I am trying to run the exe in an other machine I cannot open it and I get an error saying that it cannot find the QtCored4.dll.I must say that in this second machine I have already set the bin directory in my path variable.So when I create a project in this machine I can run the exe file properly. Do you know what is going wrong? And how I could run the created exe in other machines without having problems?

July 3, 2011

Alexandr Ekimov Alexandr Ekimov
Lab Rat
7 posts

run my application in release mode

it cannot find the QtCored4.dll

One of these statements is incorrect.

 Signature 

Ekimov Alexander,
http://www.ekimoff.com

July 3, 2011

jk_mk jk_mk
Lab Rat
108 posts

Well I have managed to run my exe file by copying all the dll’s files in the same directory with exe file. So I managed to run the exe in two different machines, which both have the same version of Qt. I want to know, if I tried to run the exe in a PC which will not have installed the Qt, then could I take my results?Or is it neccesery to run the exe on pc’s with Qt installed?

July 3, 2011

1+1=2 1+1=2
Hobby Entomologist
638 posts

jk_mk wrote:
Well I have managed to run my exe file by copying all the dll’s files in the same directory with exe file. So I managed to run the exe in two different machines, which both have the same version of Qt. I want to know, if I tried to run the exe in a PC which will not have installed the Qt, then could I take my results?Or is it neccesery to run the exe on pc’s with Qt installed?

http://doc.qt.nokia.com/4.7/deployment-windows.html

July 3, 2011

Zlatomir Zlatomir
Hobby Entomologist
361 posts

To distribute the application on a system without Qt installed (or without Qt dlls in path) you copy the .dll files into the same folder as the .exe file, there is one dll for each Qt module you used into your project (ex: QtCore4.dll, QtGui4.dll, etc) and you also need the run-time dlls of the compiler you use (in your case you need the vs2010 redist to be installed)

But you messed up something (see Alexandr’s post) because if you built (and copied) the “release” .exe then it shouldn’t ask for the QtCore d 4.dll (this one is the debug built dll) and you will need the QtCore4.dll for release .exe (without that ‘d’ in the name) – just be careful what you build and what you copy and you should be fine.

July 3, 2011

koahnig koahnig
Gene Splicer
2904 posts

The places for dlls have been nicely summarized by this post ( see also above ).

Lukas Geyer wrote:
All dependencies (DLLs), including the Qt libraries, have to be placed in one of these locations [goo.gl]

  • The directory where the executable module for the current process is located.
  • The current directory.
  • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
  • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
  • The directories listed in the PATH environment variable.

Certainly you can copy every time the exe and the dll to the desired directories. But with vs2010 you may want to create a “Setup and Deployment” project. If you add a project in vs you should have such a possibility under other projects.

As Zlatomir pointed out, you are using a debug dll with a release compilation? That should not happen.

One last important thing for distribution of your project’s results are the license conditions.

July 3, 2011

jk_mk jk_mk
Lab Rat
108 posts

Well I fixed the problem of QtCore4.dll, as I build my application in release mode from scratch.
I have created the exe file in vs2010 (windows7 64 bit) and now I am trying to run it in a pc (windowsXP 32 bit) with vs2008.As I can understand it is not necessery to install Qt in the second pc. I copy all the bin folder including the dll’s and the exe file in the second pc. I have installed vs2010 redist in the second pc.But when I double click on the exe I get a message saying that msvcp100.dll is missing from my pc. I downloaded and copy this dll in the folder, and I have tried to run again the exe. But now I get a message saying that msvcpr100.dll is missing from my pc. I download this dll again but again I cannot run the exe.
Am I missing something?

July 3, 2011

koahnig koahnig
Gene Splicer
2904 posts

You are missing the VS2010 specific dlls. That is why I was already adding:

koahnig wrote:

Certainly you can copy every time the exe and the dll to the desired directories. But with vs2010 you may want to create a “Setup and Deployment” project. If you add a project in vs you should have such a possibility under other projects.

The only way I know to handle this is the “Setup and Deployment” project. You need to consult the microsoft help text for this.

I was once doing it for VS2005. Under VS2005 you somehow detect all the dlls you need. For VS2010 you need to find your way through. I doubt that is close to VS2005 procedure.

 
  ‹‹ [SOLVED]Calling new window from menu bar      [Solved] Showing "Loading" widget while heavy processing... ››

You must log in to post a reply. Not a member yet? Register here!