PDA

View Full Version : Procedure entry point not found



Ishmael
8th October 2009, 03:27
Sigh. I finally got my little application running in Qt Creator, and now I'd like to create an executable, but alas, it's not working.

Here's what I did:
1) I changed the Run Configuration to Release, then built the app. Everything is fine.
2) Went to the "release/" subdirectory in my project and double-clicked the .exe

Here's what I got:
"The procedure entry point _Z21qRegisterResourceDataPKhS0_S0_ could not be located in the dynamic link library QtCore4.dll"

Any ideas what this means?

I'm hoping to get one simple .exe file out of all of this that already has all the necessary libraries built in. Is that possible?

Thanks for your help!

squidge
8th October 2009, 20:00
That means the QtCore4 DLL you are using doesn't have that function. It's probably a customised version. Grab t he one from the QtCreator bin directory - it should have all the functions.

If you want a single exe rather than being dependant on several DLLs, then you'll have to recompile Qt with the appropriate options (-static rather than the default -shared passed to configure), and don't forget that also your application must be open source or use commercial license, else Nokia will sue your ass. Thats way library method is the default, as you can then use LGPL license.

Ishmael
8th October 2009, 20:12
What do you mean by "grab the one...in the bin directory"? Do I need to add a line in my .pro file that tells it where to look? I've made a copy of the QtCore4.dll file in my "release/" directory, but it appears to have no effect.

I certainly don't have a "customised" version of any dlls. I just downloaded Qt a few weeks ago. Everything is vanilla Qt as far as I know.

Where do I put the '-static' option? In the .pro file? I can't seem to find any compiler settings in Qt Creator.

Also, I decided to try to compile one of Qt's example files just to make sure that works, but it doesn't work! I tried the 'elastic nodes' example, and when I try to run the release version of the code, it tells me "The procedure entry point _Z5qFreePv could not be located in the dynamic link library QtCore4.dll".

What am I doing wrong?

P.S. Don't worry, all of my code will be open source - not that anyone would care to look at it.

Ishmael
9th October 2009, 19:27
Ok, so I finally found the answer (why oh why can't they make error messages more helpful?)

In order to build a simple, standalone .exe file, you have to build Qt itself statically. The directions on how to do this are below. The default is to build everything dynamically. Note that building Qt statically takes several hours.

http://doc.trolltech.com/4.5/deployment-windows.html

squidge
9th October 2009, 19:32
By 'bin' directory I mean the one that contains designer, assistant and linguist. It contains a fully working QtCore4 dll which you can copy to your release directory and then retry running your compiled exe. If that works, you have a customised QtCore4.dll somewhere that is missing functions.

As for -static, you need to pass it to configure when you recompile Qt. This means you need to open a DOS Box, setup the paths to your compiler in there, and call configure with the appropriate arguments such as platform and -static. One the compilation has finished (it can take a few hours) then you can build executables that have all the necessary libraries built in.

ChrisW67
11th October 2009, 08:15
If you are using the Nokia distributed SDK on Windows, e.g. installed in "C:\Qt\2009.03", then the 'bin' directory containing the redistributable libraries is not "C:\Qt\2009.03\bin" but rather "C:\Qt\2009.03\Qt\bin". The former directory contains the runtime that Creator was built against, the latter the one your application was built against. They are not the same.