none
Why Can't .exe Find DLL In Same Folder? RRS feed

  • Question

  • Hello Folks:

       Developing 32 bit C++ application on Win 7/64.  Win32, no MFC. 

       On an old laptop running XP Home, an executable can't find a DLL that is in the same folder.  The application runs fine on Win 7/64 and XP Media Center. 

       I'm using Inno Setup to install my application (TFA) in user's C:/program files/tfa. 

       That folder has the executable TFA.EXE and several DLLs, including FBCLIENT.DLL.  This is the DLL for the Firebird database engine. 

       The program TFA.EXE runs fine on my Windows 7 PC and a desktop running XP Media Center. 

       TFA.EXE fails when run on my old laptop running XP Home.  It complains about not being able to find FBCLIENT.DLL. 

       FBCLIENT.DLL is right there in the same folder as TFA.EXE. 

       Why would an executable be unable to find a DLL that is in the same folder? 

       Why would this work on Windows 7 and XP Media Center, but fail on XP Home. 

       XP was reinstalled on the laptop in the last month, so I don't think it's had time to be too corrupted. 

       If you're brave, or have a virtual OS, a link to the setup file can be found on this page:

             http://tfa.us.com/02_other_pages/download_free_tfa/01_download.shtml

          Thanks
          Larry



    Friday, January 25, 2013 8:13 PM

All replies

  • Hi

    can you use the DependencyWalker and try to find whether the application is looking for some other dll, the problem may not be with this dll, in fact the Dll could be linking some other dll and that could be failing and hence failing this one as well. 

    only Dependency walker can give your correct picture.

    where to find:

    http://www.dependencywalker.com/

    regards

    pradish

    Thursday, February 7, 2013 2:53 PM
  • Had a similar problem.  Tried to link a C# program to a C++ DLL.

    At first, it was complaining the DLL wasn't in the right format, so I switched the C# configuration from x64 to x86.  Then I started getting the DLL-not-found error.

    The reason: When I switched configurations, the EXE went into a DIFFERENT folder: bin\x86\Debug instead of bin\Debug, which had my DLL.  Copying the DLL to bin\x86\Debug solved the problem.

    Tuesday, August 1, 2017 8:09 PM