I cannot run my executable file(exe file)!
Hey guys
I have a problem. I built the executable file(exe file) of my project but I cannot run it. I jut get this error:
http://upload.tehran98.com/upme/uplo...c73babe851.png
while I can run it in the QT but I cannot run it separately. I followed these two page but still nothing!:
http://stackoverflow.com/questions/2...-in-qt-creator
http://stackoverflow.com/questions/8...qt-application
Re: I cannot run my executable file(exe file)!
You probably built your app with MinGW but you are trying to run it with MSVC compatible libraries. Where did you copy Qt5Core.dll from?
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
wysota
...Where did you copy Qt5Core.dll from?
from this addres:
Qt5.3.0\Tools\QtCreator\bin
to this:
Qt5.3.0\Tools\QtCreator\bin\build-8-32-Desktop_Qt_5_3_0_MinGW_32bit-Release\release
Totally, how can I make a simple exe (of my project) without any extra file?
Re: I cannot run my executable file(exe file)!
This is a directory containing your QtCreator installation, not the one containing your Qt installation. The proper libraries are in Qt5.3.0\5.3.0\<something>\lib. Creating a build directory inside your QtCreator installation is an odd thing to do as well.
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
wysota
This is a directory containing your QtCreator installation, not the one containing your Qt installation. The proper libraries are in Qt5.3.0\5.3.0\<something>\lib. Creating a build directory inside your QtCreator installation is an odd thing to do as well.
Well that was the default suggestion of QT for creating the project and so I didn't change it.
ok, I just created this directory:
C:\Users\[my user]\Documents\8-32
and I built my project in realese mode and when I run the program(by double click) again I get the error.
Why we cannot make our project without any other files?
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
Ryan111
Well that was the default suggestion of QT
QT is QuickTime.
Qt is an application development framework in a form of a set of libraries and tools.
Qt Creator is an IDE based on Qt.
Please don't mix the terms.
Quote:
and I built my project in realese mode and when I run the program(by double click) again I get the error.
Did you copy the libraries?
Quote:
Why we cannot make our project without any other files?
Ask uncle Bill.
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
wysota
QT is QuickTime.
Qt is an application development framework in a form of a set of libraries and tools.
Qt Creator is an IDE based on Qt.
Please don't mix the terms.
QuickTime?
What are you saying,bro? as far as I know we are speaking around Qt Creator and all things that you defined in your second sentence. aren't we?
Quote:
Originally Posted by
wysota
Did you copy the libraries?
Which libs? where are those? and also where should I paste them?
Quote:
Originally Posted by
wysota
Ask uncle Bill.
Each program we make must have these files?
Added after 4 minutes:
How do you make your programs? do you only do all above things? is there any standard way to make our programs?
Re: I cannot run my executable file(exe file)!
On Windows systems, use the dependency walker to identify the *exact* dll dependencies your executable will need to run correctly.
Since you're using Qt5, you may also want to use windeployqt. I haven't used it personally because I don't do Windows, but the macdeployqt counterpart for OSX is very helpful.
Good luck.
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
Ryan111
Each program we make must have these files?
It depends. If you dynamically link to the libraries, they must be resident in a location that they can be found to successfully launch the executable. That is not specific to Qt and applies to any program.
You can build Qt such that it produces static libraries for Qt. If you link against those static libraries, the Qt code will become part of your executable. The executable will be *much* larger, but the benefit is that you can ship your executable without working about Qt run-time libraries being present on the target computer.
When I first started with Qt, I thought I'd build static libraries to avoid having to deliver Qt libraries, however, I have standardized on the standard Qt distributions which are all dynamic libraries. Once you figure out how to package/distribute the Qt dynamic libraries with your app, it's really not a big deal.
Just my $.02 worth.
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
Ryan111
QuickTime?
What are you saying,bro?
I am saying you should use the lowercase "t" when talking about Qt and that you should use the term "Qt Creator" when talking about the program that suggested you to create a build directory somewhere.
Those you have in your attachment to post #1.
Post #4.
Quote:
and also where should I paste them?
Post #3.
Quote:
Each program we make must have these files?
That's how dynamic linking works in Windows. You can copy all those libraries to your C:\Windows\system equivalent instead if you want. Just be prepared for a DLL hell ;)
Quote:
How do you make your programs? do you only do all above things? is there any standard way to make our programs?
This is all standard stuff, you know. Totally unrelated to Qt itself. There is also a "Deploying an Application on Windows" article in Qt reference manual telling you the basic stuff you need to know. Of course you should have known that before...
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
wysota
I am saying you should use the lowercase "t" when talking about Qt and that you should use the term "Qt Creator" when talking about the program that suggested you to create a build directory somewhere.
fine.:)
Quote:
Originally Posted by
wysota
That's how dynamic linking works in Windows. You can copy all those libraries to your C:\Windows\system equivalent instead if you want. Just be prepared for a DLL hell ;)
oh god.
Quote:
Originally Posted by
wysota
This is all standard stuff, you know. Totally unrelated to Qt itself. There is also a "Deploying an Application on Windows" article in Qt reference manual telling you the basic stuff you need to know. Of course you should have known that before...
yeah, I have to have a look in it.
Thanks dude.
Added after 42 minutes:
This video helped me to make my program:
www.youtube.com/watch?v=raueG9n6rC4
the size of release folder is 48MB. Too big!:(
Re: I cannot run my executable file(exe file)!
Quote:
Originally Posted by
Ryan111
the size of release folder is 48MB. Too big!:(
Too big for what? 48MB is nothing nowadays.
Think of it this way, you can choose to not use Qt and write 100% of all of the code yourself. This will give you the smallest possible executable size and or redistribution package size. This would require, however, that you deal with all of the OS specific windowing/GUI requirements, file system, networking services, and on and on...
Or you can benefit from the thousands of hours of coding and testing that goes into the creation/maintenance of Qt and write a fraction of the code yourself, and ship a 48MB package. As a side benefit, by using Qt, your code is portable to all major operating systems, so don't discount the benefit of that either!
I know which choice I would make!
Re: I cannot run my executable file(exe file)!
I will never leave Qt. it's cute!:o