Building SpoutDX.dll with SpoutDX12 included

Hellooooooo!

I’m trying to build SpoutDX as a dynamic library with the experimental DX12 functions included. Apparently, I’m not really good with CMake and building libraries, and I cannot figure out how to make this work.

So far I’ve used CMake to generate the VS solution files. I was able to build SpoutDX as a dynamic lib and the resulting dll file works as expected in my host application (Unreal in this case).

Now to add the DX12 functionality, I’ve tried adding SpoutDX12.h and SpoutDX12.cpp to the project via the CMakeLists.txt file (found in SpoutSDK/SpoutDirectX/SpoutDX). Specifically, I’ve added SpoutDX12/SpoutDX12.h and SpoutDX12/SpoutDX12.cpp to the Spout DX SHARED library (defined on line 121 in CMakeLists.txt).

After building the library again, I see that SpoutDX12.cpp is compiled, however, after copying the resulting dll file to the host project and compiling it using DX12 functions, I get unresolved symbol errors for all spoutDX12 functions.

If anyone can spot what I’m doing wrong, I’d greatly appreciate some pointers on how I should approach this!

Hi Joris,

that’s an interesting project.

You will need the header file “SpoutDX12.h” in your Visual Studio project in addition to those required for the SpoutDX library that you generate. Let me know if that works.

Edit -
Another thing to try.

Change :
class spoutDX12 : public spoutDX
to :
class SPOUT_DLLEXP spoutDX12 : public spoutDX

Thanks for thinking along with me, Lynn!

I’ve correctly included the required headers. I can also declare a spoutDX12 object and use the DX12 specific functions when writing code. However, when building the Unreal VS project, I get unresolved external symbol errors for these functions. These errors persist also after adding the SPOUT_DLLEXP definition to the spoutDX12 class.

Since the other regular Spout functions resolve correctly, I’m assuming I’ve done something wrong with building the dll. Could it be related to the folder structure (ie the SpoutDX12 files living in their own subfolder)?

I think it could be something to do with the CMake file. Is it possible for you to modify the DX12 example sender project using a the dll instead of source files. Then I might be able to reproduce it here.