Results 1 to 4 of 4

Thread: Cannot load DLL.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2013
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Cannot load DLL.

    I am using Qt 4.7 on a Windows 7, 64-bit machine. I am trying to load a third party DLL. In their source file they call LoadLibraryA(functionName) to load the library at run time. The code checks for a handle returned when the DLL is loaded.

    This is my problem: Every time I run my code it gets to the point of loading the library but the returned handle value is NULL. This causes the program to crash (Segmentation fault). In my application output window I get "(Internal error: pc 0x0 in read in psymtab, but not in symtab.)".

    The twists: Originally another programmer integrated the third party code into the application and the application runs just fine on his machine. I am using his code exactly and I get the crash. I tried the application on a 32-bit laptop. Originally it did not work. However when I uninstalled Qt 4.7 and reinstalled it, the application works. (This may be a red herring....)

    Debugs I have tried: 1) I have tried using Dependency Walker. The results I get when I run DW on my application exe are the same ones he gets. 2) I have uninstalled and re-installed Qt on my machine 3) I have verified that the DLL is in the same directory as the executable

    Any thoughts?

    Thanks.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Cannot load DLL.

    Is your Qt app compiled as a 64-bit app? Is the third-party DLL a 64-bit DLL? On Windoze 7, all executable parts (exe, dll, etc.) must be all 64-bit or all 32-bit. You can't mix and match 64-bit and 32-bit like you could with 32-bit and 16-bit code on Windows XP.

    If the 3rd-party DLL is 32-bit, try recompiling your app (and Qt) in 32-bit mode (or get someone else to do it with a 32-bit compiler and Qt) and see if that makes a difference. A 32-bit app with all dependencies also 32-bit will run just fine on Win 7.

Similar Threads

  1. Replies: 6
    Last Post: 4th March 2013, 20:20
  2. 100% CPU load
    By kartun in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2011, 07:11
  3. DLL won't load
    By waynew in forum Qt Programming
    Replies: 8
    Last Post: 25th October 2010, 01:48
  4. Save to SVG and load from it
    By Radagast in forum Qt Programming
    Replies: 3
    Last Post: 14th June 2008, 14:22
  5. Qt4 does not load JPG's.
    By Teuniz in forum Qt Programming
    Replies: 3
    Last Post: 3rd September 2007, 23:06

Tags for this Thread

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.