Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Help please - Windows error 126 (missing dependency) - relates to openal32.dll ?  (Read 2165 times)

0 Members and 1 Guest are viewing this topic.

binaryduke

  • Newbie
  • *
  • Posts: 5
    • View Profile
Hi

I am writing a DLL that uses smfl-audio. My IDE is Visual Studio Community 2017. I believe I have the IDE set up correctly:

- additional include directories point to the SFML\include directory
- additional library directories point to the SFML \lib directory
- Preprocessor definitions specify SFML_STATIC
- all 5x sfml .lib libraries are specified as additional dependencies together with each module's dependencies specified for static linking.

Everything compiles just fine.

When my DLL is called, I get a Windows error 126 - which means the DLL has a missing dependency.

I have placed the openal32.dll file from the \bin directory in each and all of:
- the directory where the DLL resides
- the directory where the .exe that calls the DLL resides
- c:\System32
- c:\SysWOW64

and none of this makes a difference.

I have tried linking to the static versions of the .libs (-s suffix) which results in a LNK2038 mismatch detected for RuntimeLibrary: value MD_DynamicRelease doesn't match value MT_Static Release from the sfml-audio-s.lib file during compilation. This is confusing!

(I have successfully compiled and run using dynamic linking and including sfml-audio-2.dll and sfml-system-2.dll in my dll's directory and removing the preprocessor SFML_STATIC definition, but I am eager to successfully create static linking and only distribute openal32.dll with my dll file).

Any pointers will be gratefully received!

Thx BD.
« Last Edit: September 06, 2018, 08:49:10 am by binaryduke »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
As the tutorial states, if you want to link statically, you have use libraries with the -s suffix and define SFML_STATIC.
What the difference between MT, MD and MTd, MDd is, can easily be googled. In the end it just has to match for your project and the libraries you link.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/