CMake modules binarydata

I looked at some examples on github but everything is too complicated. JUCE example is simple and works by default, but I struggle with adding my own modules and binary data. I start with the GuiApp example with JUCE in the subfolder. My modules are in the subfolder, as are resources.
I get an unresolved externals error for the cpp file from my module.
And I don’t know how to create data from resources, and how to call them in code.

Here is starting code

Any help is welcome, thanks

For the undefined symbols, you need to make sure that you link your custom module to your gui app target in target_link_libraries. You’re currently linking GuiAppData and juce::juce_gui_extra, but you need to link my_module too.

To use the binary data definitions, you need to #include "BinaryData.h" in the files that will use the definitions.

1 Like

Thanks, I already tried it but then I got a bunch of errors, totally unrelated, so I thought it was definitely wrong … but the errors were due to #include <juce_gui_extra / juce_gui_extra.h> in one header file of my module.

And after the correct build, BinaryData.h also appeared automagically!
Always do one thing at a time :laughing:

Thank you