PDA

View Full Version : Fortune Server and Client Example Programs



Mike_m
27th July 2017, 10:57
Hello,
I have compiled and ran Fortune Server and Client example programs that came with Qt as shown below:

12525

12526

These two programs are working as shown above when I ran from Qt Creator Window.

However, when I exit Qt Creator and directly run these two programs
by double clicking on their exe file names in Microsoft Windows Explorer,
these two programs are NOT starting and giving following errors:

12527

May I please know how to run Qt programs by double clicking their exe file names in Microsoft Windows Explorer?

I have server exe file at following location/path:



C:\Qt\Qt_account_forum\build-fortuneserver-Desktop_Qt_5_9_0_MinGW_32bit-Debug\debug


Thanks

high_flyer
27th July 2017, 12:38
The Qt dlls location nees ot be known to the exe.
When you run it from QtCreator it provides the paths.
When you run it from explorer the exe does not know where to look for the DLLs.
You can either copy the DLLs to the same folder where your exe is, or add the Qt DLLs path to the PATH system variable.

Mike_m
27th July 2017, 14:32
Hello high_flyer,
Thank you very much.
How to the find the location/path of DLL please?
Or can you please let me know couple of DDL names?
Then I can search for those names of DLLs on my computer and add their path to my environment variable.
Best regards,

high_flyer
27th July 2017, 15:18
The Qt DLLs are under: <The path of your Qt installation>/5.8/mingw491_32/bin/
(In this case its Qt5.8, if you have another version, the '5.8' folder will reflect the version you installed.
The above path is for Qt for windows which is built and deliverd with MinGW.
If you installed the MSVC version, it should be similar, only instead of mingw491_32 something that sounds more microsoft like.

Mike_m
28th July 2017, 04:46
Hello high_flyer,
Thank you for dll path information.

MY Qt installation folder and dll path is:


C:\Qt\5.9\mingw53_32\bin


This path is in my Windows 10 environment path variable.

When I run path command at DOS command prompt, I am getting above folder path listed.

This folder path has dll files such as:


libEGL.dll, opengl32sw.dll, Qt5Charts.dll, Qt5Core.dll etc


I had this path variable for almost during past one month since I installed my Qt trial version.

I am getting this "Entry Point Not Found" error, why?

Is there any other information I need to provide please?

Best regards,

Added after 25 minutes:

I closely observed the above error message.
It is saying following error message:



The procedure entry point _ZdaPvj could not be located in the dynamic link library
C:\Qt\5.9\mingw53_32\bin\Qt5Guid.dll


I have highlighted in yellow color below in screen capture image:

12529

Looks like these kinds of errors are coming for many other dll file names also, not for one dll name.

What is _ZdaPvj procedure entry point, please?

Thanks for any information to resolve these errors.

Mike_m
28th July 2017, 08:25
I have found the answer by searching Google for
_ZdaPvj procedure


Following search result has answer:

https://stackoverflow.com/questions/13360014/the-procedure-entry-point-znst8-detail15-list-node-base7-m-hookeps0-could-not

Reason for the error is:
C++ name mangling. It happens if same dll file name is in multiple folders that are in the path variable.

Solution:
moved up Qt dll folder path to beginning of the path variable folders.

Any side effects?
I am not sure by moving up the Qt dll path to beginning of Path's various folders if I have broken another of my other programs or not.

Is there a better or an alternate solution to fix this error?

high_flyer
28th July 2017, 11:48
The problem was not with Qt per se, but the libstd lib that Qt depends on.
Since you installed Qt built with MinGW and not MSVC, you have two different libstdc variants, one for MinGW which your Qt usese, and one from Microsoft.
That is why the solution of moving the Qt installation up in the PATH variable works, since now the correct libstdc gets found before the wrong one.
Side effects may be if other software using the MS libstdc will stumble on the MinGW one.

Other possible solutions:
- Install the MSVC Qt version.
- Copy the Qt libs that you need to the folder of your exe.
- Static link your exe to Qt
- Probably you could do some things in the registry to have your application link to Qt without changing PATH - but this is just a guess, I am not so much of windows person.
- Use Linux ;-)

Mike_m
28th July 2017, 13:05
high_flyer,
Thank you very much for excellent alternative solutions.

For now I like to Static Build my Qt exe.
Then I can take this static build exe file to any other Windows computer and run the exe. Is this correct?
Can you please give steps for static building the exe?
Or can you please let us know where in the Qt documentation, the steps for static building the exe?
Best regards,

high_flyer
28th July 2017, 13:35
For now I like to Static Build my Qt exe.
That is an alternative, but be sure to weigh the trade offs.
Note that you will need a static linked Qt as well.


Then I can take this static build exe file to any other Windows computer and run the exe. Is this correct?
Yes.


Or can you please let us know where in the Qt documentation, the steps for static building the exe?
This looks to be a good place to start:
http://doc.qt.io/QtForDeviceCreation/qtee-static-linking.html