Home to Foleys Finest Audio

BinaryData.h not found [SOLVED]

Hello !
Sorry for the noob question, just trying to setup and facing an issue about missing BinaryData namespace, cannot figure out what I’m doing wrong, any clue ? I just followed the instructions for setup from the main post but to not avail…

Thanks !

Actually that post I’m mentioning was a bit incomplete, I had to change a few thing:

  • add the “extras” directory of JUCE in the header search path
  • inherit my processor from foleys::MagicProcessor
  • remove createEditor() and hasEditor() methods as well
    These are explained in the README however, just to point people that would try to setup using just the post of the forum…
    Now that’s loading fine, I’m proceeding further and try to understand how to use that :slight_smile:

Welcome @lorenzolamasse!

Great that you found the solution already. When you followed the video first that I did for theaudioprogrammer a while back, then there is a difference. I meant to do an update, I hope I will find the time soon.
Without the MagicProcessor you do unneccessary things at best, or if you are unlucky it doesn’t work out of the box. I hope the simplifications with MagicProcessor still made the changes worthwhile.

The BinaryData issue however is curious. I had that issue once in a Xcode project generated from cmake. But hitting build a second time always fixed it. It seems to me like there is something weird in the build setup.
In the CI / github actions however it works. Something for me to check, if that can be solved in a better way.

Good luck with the further projects and let me know when I can help (or anybody here from the community).

1 Like

Hi !
Seems my issue is back again, I can’t seem to compile, this line fails:
magicState.setGuiValueTree (BinaryData::magic_xml, BinaryData::magic_xmlSize);
with error:
No member named ‘magic_xml’ in namespace ‘BinaryData’
No member named ‘magic_xmlSize’ in namespace ‘BinaryData’

I have added a graphical element to my project to ensure BinaryData.h/cpp would be baked in, and added #include “BinaryData.h” in my processor cpp, but there is no reference anywhere about these to items that I can find, even in your module’s code ?
any clue ,
Thanks !

Ok, let’s have a look.
First question, are you using the Projucer or cmake for your project?

In Projucer you should go back in the Projucer and make sure the magic.xml file is added to the resources as Binary Resource, NOT xcode resource.
Then click “Save Project”. This will regenerate the BinaryData.h and BinaryData.cpp files so they will include the magic.xml file that you created with the PGM and added to the BinaryData.
Now build the project again. The BinaryData should contain now the magic_xml and magic_xmlSize.

If you use cmake make sure the magic_xml file is added in the CMakeLists.txt file. The change of the CMakeFiles.txt should trigger a recreation ofthe project without leaving Xcode.

Let me know if that solves the issue.
If not please include a few details about your build setup (IDE etc.)…

Good luck!

I’m using latest Projucer for my project, running Xcode 11.3.1 under Mojave.

I’m not sure I understand how I can generate the magic.xml file if I cannot even build my project which is necessary to generate that file ? Should I try to use the auto generated GUI, and create the file from that build before staging the BinaryData back into my code ?

Seems I found a workaround: created an empy Magic.xml file and added it to my Projucer project, an then it triggered the proper inclusion of BinaryData.h/cpp.
In the mean time I have switched to another computer running Big Sur and Xcode 12.5, don’tt think it has a link, I’ll try again tonight, back on my main dev station.

Oh, that is totally my bad!
Yes, you need first to leave that line out, if there is no magic.xml file yet. Since BinaryData means baking the code into the binary, you would need to recompile anyway.

I need to document better, that this line is to be added later.

There is an alternative though, When using OSX you can also put a file into a bundle. That way you can change the GUI without recompiling:

This way you cn save the magic.xml file in the Resources folder and play with it without recompiling.
But careful, a build clean will wipe that location!

Copyright © 2020 Foleys Finest Audio UG. All rights reserved.