# CMake modules binarydata

**URL:** <https://forum.juce.com/t/cmake-modules-binarydata/50934>\
**Category:** CMake\
**Created:** [April 8, 2022, 4:02pm UTC](https://forum.juce.com/t/cmake-modules-binarydata/50934 "2022-04-08T16:02:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gopo](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@gopo](https://forum.juce.com/u/gopo)\
**Post date:** [April 8, 2022, 4:02pm UTC](https://forum.juce.com/t/cmake-modules-binarydata/50934/1 "2022-04-08T16:02:43Z")

</div>

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

> **[GitHub - gopo9/cmake-test](https://github.com/gopo9/cmake-test)**
>
> Contribute to gopo9/cmake-test development by creating an account on GitHub.

Any help is welcome, thanks

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [April 8, 2022, 6:07pm UTC](https://forum.juce.com/t/cmake-modules-binarydata/50934/2 "2022-04-08T18:07:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gopo](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@gopo](https://forum.juce.com/u/gopo)\
**Post date:** [April 8, 2022, 7:02pm UTC](https://forum.juce.com/t/cmake-modules-binarydata/50934/3 "2022-04-08T19:02:05Z")

</div>

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 😆

Thank you
