Results 1 to 9 of 9

Thread: Fortune Server and Client Example Programs

  1. #1
    Join Date
    Jun 2017
    Posts
    19
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Fortune Server and Client Example Programs

    Hello,
    I have compiled and ran Fortune Server and Client example programs that came with Qt as shown below:

    fortune_server_screen_01.PNG

    fortun_client_screen_01.PNG

    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:

    fortune_server_entry_point_error_screen_01.PNG

    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:

    Qt Code:
    1. C:\Qt\Qt_account_forum\build-fortuneserver-Desktop_Qt_5_9_0_MinGW_32bit-Debug\debug
    To copy to clipboard, switch view to plain text mode 

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Fortune Server and Client Example Programs

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jun 2017
    Posts
    19
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Fortune Server and Client Example Programs

    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,

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Fortune Server and Client Example Programs

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jun 2017
    Posts
    19
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Fortune Server and Client Example Programs

    Hello high_flyer,
    Thank you for dll path information.

    MY Qt installation folder and dll path is:
    Qt Code:
    1. C:\Qt\5.9\mingw53_32\bin
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. libEGL.dll, opengl32sw.dll, Qt5Charts.dll, Qt5Core.dll etc
    To copy to clipboard, switch view to plain text mode 

    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:

    Qt Code:
    1. The procedure entry point _ZdaPvj could not be located in the dynamic link library
    2. C:\Qt\5.9\mingw53_32\bin\Qt5Guid.dll
    To copy to clipboard, switch view to plain text mode 

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

    fortune_server_entry_point_error_screen_02.PNG

    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.
    Last edited by Mike_m; 28th July 2017 at 04:46.

  6. #6
    Join Date
    Jun 2017
    Posts
    19
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Fortune Server and Client Example Programs

    I have found the answer by searching Google for
    _ZdaPvj procedure


    Following search result has answer:

    https://stackoverflow.com/questions/...eps0-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?
    Last edited by Mike_m; 28th July 2017 at 08:33.

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Fortune Server and Client Example Programs

    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 ;-)
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. The following user says thank you to high_flyer for this useful post:

    Mike_m (28th July 2017)

  9. #8
    Join Date
    Jun 2017
    Posts
    19
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Fortune Server and Client Example Programs

    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,

  10. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Fortune Server and Client Example Programs

    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...c-linking.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  11. The following user says thank you to high_flyer for this useful post:

    Mike_m (28th July 2017)

Similar Threads

  1. Implementing a Fortune Server
    By KeineAhnung in forum Newbie
    Replies: 6
    Last Post: 20th June 2014, 18:05
  2. qtservice based on threaded fortune server
    By raj_iv in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2011, 13:58
  3. Fortune Server example
    By babu198649 in forum Newbie
    Replies: 2
    Last Post: 19th February 2011, 10:04
  4. doubt in blocking fortune client example
    By wagmare in forum Qt Programming
    Replies: 9
    Last Post: 19th February 2009, 14:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.