PDA

View Full Version : Says I am missing a .dll file that is there



bijan311
27th February 2010, 21:45
I just installed QT4 and i read this tutorial for a hello world program. When i compile it it say I do not have the QTCore4.dll file so the .exe file cannot run. I then looked in the QT folder and i found QTCore4.dll in the bin folder. Here is my code if it matters.


#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
QApplication app(argc,argv);

QPushButton test("I am testing my first GUI application");
test.show();

return app.exec();
}


I am also using the Code::Blocks IDE with the MinGW compiler. Thanks.

squidge
27th February 2010, 21:56
Is the directory containing the DLL in your PATH ?

bijan311
27th February 2010, 22:05
I don't know, how do i check?

squidge
27th February 2010, 22:36
Start->Run, type "cmd", hit enter. When block box appears, type "echo %PATH%" and press enter.

bijan311
27th February 2010, 22:44
ok it says, "C:\Windows\system32;C:\Windows\System32\Wbem;C:\Wi ndows\System32\WindowsPowerShell\v.1.0\;C:\Program Files\Quicktime\QTSystem

schnitzel
27th February 2010, 23:02
ok it says, "C:\Windows\system32;C:\Windows\System32\Wbem;C:\Wi ndows\System32\WindowsPowerShell\v.1.0\;C:\Program Files\Quicktime\QTSystem

try running your app from the Qt Command Prompt which sets up the required environment variables and path for you.

bijan311
27th February 2010, 23:11
Ok when I did that it said "The procedure entry point _ZN7QString16fromAscii_helperEPKci could not be located in the dynamic link library QtCore4.dll"

schnitzel
28th February 2010, 03:24
Please start a Qt command prompt and show us what is printed to the console.

bijan311
28th February 2010, 03:55
http://bijanscrap.webng.com/qt_prompt.png
Is this what you are talking about?

schnitzel
28th February 2010, 04:47
now I'd like to see the entire path from this command prompt - just type 'path'. Also cd into the folder where your app is and run it. If you can show all this in a screenshot like you did.

bijan311
28th February 2010, 05:17
http://bijanscrap.webng.com/qt_prompt2.png
Here it is.

schnitzel
28th February 2010, 05:22
http://bijanscrap.webng.com/qt_prompt2.png
Here it is.

looking at your code... where did you get this example?

It seems like a console app but you are trying to use widgets. Can you show how you build this exe and all the files that are part of it?

squidge
28th February 2010, 11:29
Your program is using the wrong DLL - it's using the one in c:\qt\4.6.2\bin rather than the one in c:\qt\4.6.2\qt\bin

The problem is that QtCreator requires the DLL in bin whilst your program requires the DLL in qt\bin.

One way of solving the problem would be to copy the QtCore4 and QtGUI4 DLLs from c:\qt\4.6.2\qt\bin to the directory where your executable is (The 'release' dir)