SFML community forums
Help => Audio => Topic started by: binaryduke on September 06, 2018, 08:19:50 am
-
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.
-
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.