Jump to content
  • Advertisement
Sign in to follow this  
Little Coding Fox

Strange bug with DLLNotFoundException

This topic is 3348 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings everyone, I have a C# program that calls C functions from a Native C++ DLL, using the DLLImport attribute on some functions. However, whenever i try to call any of the functions, i get a DLLNotFoundException. I have the C# program compile to x86 only, and the DLL is in the exact same folder as the executable, yet it will constantly tell me the DLL could not be found, "The module could not be found". However, if i e.g., copy the program's executable and rename it as the DLL's filename, it'll instead tell me it can't find the entry points it needs, which means it did find and load the "DLL". I have the DLL's functions being exported with C linkage, and i'm using Visual Studio 2008 Professional. I'm also sure the Working Directory is correct. Even running the program on the same folder as the DLL will terminate with a crash (uncaught Exception). Would anybody have any idea as to what could be causing this strange behaviour? Thank you very much for your time regarding this message, and have a nice day!

Share this post


Link to post
Share on other sites
Advertisement
I figured out what's wrong, it would seem that the lack of a DLL on the DLL's dependencies would cause this exception, without warning. Using dumpbin /imports helped me notice that a DLL was missing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!