# Error opening example files

**URL:** https://forum.foleysfinest.com/t/error-opening-example-files/116
**Category:** PluginGuiMagic
**Created:** [13 June 2022 12:28 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116 "2022-06-13T12:28:55Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![mehmethan](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mehmethan](https://forum.foleysfinest.com/u/mehmethan)
#### Post date: [13 June 2022 12:28 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/1 "2022-06-13T12:28:55Z")

</div>

Hi I’m a newbie JUCE user. I wanted to check PluginGuiMagic. I cloned GitHub to check examples. When I want to compile them I have this error. Can you help me please? (Mac osx 12.4 - M1 apple - Juce 6.1.6 - Xcode 13.2.1)

Undefined symbol: foleys::MagicGUIState::setResourcesFolder(juce::String const&)

Showing Recent Messages  
Ld /Users/md/PluginGuiMagic/examples/APVTS\_Tutorial/Builds/MacOSX/build/Debug/PGM-APVTS-Tutorial.app/Contents/MacOS/PGM-APVTS-Tutorial normal (in target ‘PGM-APVTS-Tutorial - Standalone Plugin’ from project ‘PGM-APVTS-Tutorial’)  
cd /Users/md/PluginGuiMagic/examples/APVTS\_Tutorial/Builds/MacOSX  
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-macos10.11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -L/Users/md/PluginGuiMagic/examples/APVTS\_Tutorial/Builds/MacOSX/build/Debug -F/Users/md/PluginGuiMagic/examples/APVTS\_Tutorial/Builds/MacOSX/build/Debug -filelist /Users/md/Library/Developer/Xcode/DerivedData/PGM-APVTS-Tutorial-afyajcxifequxnctiwjkhzhiowzd/Build/Intermediates.noindex/PGM-APVTS-Tutorial.build/Debug/PGM-APVTS-Tutorial\ -\ Standalone\ Plugin.build/Objects-normal/arm64/PGM-APVTS-Tutorial.LinkFileList -Xlinker -object\_path\_lto -Xlinker /Users/md/Library/Developer/Xcode/DerivedData/PGM-APVTS-Tutorial-afyajcxifequxnctiwjkhzhiowzd/Build/Intermediates.noindex/PGM-APVTS-Tutorial.build/Debug/PGM-APVTS-Tutorial\ -\ Standalone\ Plugin.build/Objects-normal/arm64/PGM-APVTS-Tutorial\_lto.o -Xlinker -no\_deduplicate -stdlib=libc++ -lPGM-APVTS-Tutorial -framework Accelerate -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreAudioKit -framework CoreMIDI -framework DiscRecording -framework Foundation -framework IOKit -framework OpenGL -framework QuartzCore -framework WebKit -Xlinker -dependency\_info -Xlinker /Users/md/Library/Developer/Xcode/DerivedData/PGM-APVTS-Tutorial-afyajcxifequxnctiwjkhzhiowzd/Build/Intermediates.noindex/PGM-APVTS-Tutorial.build/Debug/PGM-APVTS-Tutorial\ -\ Standalone\ Plugin.build/Objects-normal/arm64/PGM-APVTS-Tutorial\_dependency\_info.dat -o /Users/md/PluginGuiMagic/examples/APVTS\_Tutorial/Builds/MacOSX/build/Debug/PGM-APVTS-Tutorial.app/Contents/MacOS/PGM-APVTS-Tutorial

Undefined symbols for architecture arm64:  
“foleys::MagicGUIState::setResourcesFolder(juce::String const&)”, referenced from:  
TutorialProcessor::TutorialProcessor() in libPGM-APVTS-Tutorial.a(PluginProcessor.o)  
ld: symbol(s) not found for architecture arm64  
clang: error: linker command failed with exit code 1 (use -v to see invocation)

---

<div class="post-metadata">

### Author: ![Kingfisher](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@Kingfisher](https://forum.foleysfinest.com/u/Kingfisher)
#### Post date: [16 July 2022 22:41 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/2 "2022-07-16T22:41:19Z")

</div>

Hey, not sure if you’ve solved this yet but I was running into the same problem.

It seems that if you have the editor enabled then you need binary data enabled because it calls the setResource function which is only defined if binary data is enabled.

BUT! setResource uses BinaryData:: namespace which is defined in BinaryData.h which is a file that is only created by Projucer (and apparently CMake if you’re using that) if you have some files marked as Binary Resources in the file explorer of Projucer.

To get past this I did the following:

1. make sure that the FOLEYS\_SHOW\_GUI\_EDITOR\_PALETTE and FOLEYS\_ENABLE\_BINARY\_DATA are enabled for the foleys\_gui\_magic module
2. Add a magic.xml file to your resources (it must be called that or you must change the reference to BinaryData::magic\_xml to BinaryData::{your\_file\_name\_with\_underscores} in the constructor for your audio processor)
3. select the group that contains the new file and you will see the option to mark it as a binary resource. If it was a png or xml it will already be checked.

Now when you load your project, BinaryData.h will have been created with a magic\_xml function and all of the dependencies check out. There may be a better way, but this is all I could figure out.

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [18 October 2022 18:57 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/3 "2022-10-18T18:57:12Z")

</div>

Well I get the same error. I’m new to programming and I dont understand how to make this work. Could someone use the foley sinth example to tell me what i should put this? Just as a startup step…

The foleys::MagicProcessor will provide a `foleys::MagicProcessorState magicState` (protected visibility) to add visualisations or other objects to expose to the GUI.

The floating editor has an auto save, which needs to know the location of your source files. To activate that you need to copy this macro into your foleys::MagicProcessor constructor:

FOLEYS\_SET\_SOURCE\_PATH( **FILE** );

---

<div class="post-metadata">

### Author: ![daniel](https://forum.foleysfinest.com/user_avatar/forum.foleysfinest.com/daniel/32/5_2.png) [@daniel](https://forum.foleysfinest.com/u/daniel)
#### Post date: [31 October 2022 10:07 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/4 "2022-10-31T10:07:27Z")

</div>

Did you find this post?

> [@New way to use PGM in plugins](https://forum2.foleysfinest.com/t/new-way-to-use-pgm-in-plugins/39):
>
> Since Version 1.3.0 there is an easier way to use PluginGuiMagic in a JUCE based plugin. What stays the same is to add the foleys\_gui\_magic to the project. Instead of inheriting juce::AudioProcessor inherit foleys::MagicProcessor You don’t need to add a magicState. It is alreadt added in the new base class You don’t need to use AudioProcessorValueTree, but you can. You need to remove the hasEditor and createEditor from your processor class, so the editor is created from the base class You sho…

TL;DR:

- in the Projucer/cmake add the `foleys_gui_magic` module
- nuke the PluginEditor.h and PluginEditor.cpp, and remove the `#include "PluginEditor.h"` from PluginProcessor.cpp
- In your PluginProcessor.h change the base class `juce::AudioProcessor` to `foleys::MagicProcessor`
- get rid of the methods `hasEditor` and `createEditor` from header and source
- unless you want to implement them yourself, get rid of `getStateInformation` and `setStateInformation` from header and source
- in the constructor of your processor add this line to the body: `FOLEYS_SET_SOURCE_PATH ( __FILE__ );`

That should be all what’s necessary.

N.B. I just pushed a new release, a few obstacles are fixed now

Let me know if that works.

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [9 November 2022 20:31 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/5 "2022-11-09T20:31:14Z")

</div>

I’m pretty sure as a noob that I am missing some easy part of it. Im trying that foley sinth and when building it I get the error below. OFC it cant find the plugin as it doesnt build it, and there is only this error, nothing else. So what could it be? VS2022 Win11 Last JUCE version.  
Thank you VERY much!

 ![error](https://forum2.foleysfinest.com/uploads/default/original/1X/880e28fefe259b8c1c95dca7e25af3bd4624abd8.png)

---

<div class="post-metadata">

### Author: ![daniel](https://forum.foleysfinest.com/user_avatar/forum.foleysfinest.com/daniel/32/5_2.png) [@daniel](https://forum.foleysfinest.com/u/daniel)
#### Post date: [9 November 2022 22:06 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/6 "2022-11-09T22:06:57Z")

</div>

This is the old problem which should be fixed now. Can you please make sure that you have the latest version of foleys\_gui\_magic?  
If it is in a submodule (e.g. when you cloned PluginGuiMagic), make sure to call

```auto
git submodule update --recursive

```

so it updates the submodules to the version which is set in the main repository…

Let me know if that helped…

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [9 November 2022 22:22 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/7 "2022-11-09T22:22:32Z")

</div>

![image](https://forum2.foleysfinest.com/uploads/default/original/1X/be6f1684dcef5deb91d30584a21a5ce55735403d.png)

---

<div class="post-metadata">

### Author: ![daniel](https://forum.foleysfinest.com/user_avatar/forum.foleysfinest.com/daniel/32/5_2.png) [@daniel](https://forum.foleysfinest.com/u/daniel)
#### Post date: [9 November 2022 22:25 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/8 "2022-11-09T22:25:19Z")

</div>

![Screenshot 2022-11-09 at 23.24.52](https://forum2.foleysfinest.com/uploads/default/original/1X/1241a4236580359c5401babd6fd0ef3daa3061a4.png)

😛

It was fixed on the develop branch for a while, but I pushed a new version on main as well like I wrote above…

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [9 November 2022 22:37 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/9 "2022-11-09T22:37:45Z")

</div>

![image](https://forum2.foleysfinest.com/uploads/default/original/1X/75e0b141b465dd8d97fe4f8930f03e40ca8e116c.png)  
Well, i guess it is upated…

But why the foleyguimagic.h is not showing it?

 ![image](https://forum2.foleysfinest.com/uploads/default/original/1X/d9551abf8232b763e36f67a987b0896d1d1e0f8e.png)

The equalizer example doesnt have a subfolder with the foleys stuff… 😑

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [9 November 2022 22:47 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/10 "2022-11-09T22:47:16Z")

</div>

Somehow I made it work. ROFL. If things are hairy for the experienced, sometimes its a beginner’s luck, hm?

One thing, i tried to put this on a ready plugin code. Everything seemed to work, but that line to be added on pluginprocessor.cpp with the **FILE** shows an error. Like it is not linked… Thanks for you kind attention, btw

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [9 November 2022 22:50 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/11 "2022-11-09T22:50:17Z")

</div>

And now i would need to learn how to build stuff with it…

 ![image](https://forum2.foleysfinest.com/uploads/default/original/1X/b7cd6ecf564303024d16da876953d4a9f2ac074e.png)

---

<div class="post-metadata">

### Author: ![daniel](https://forum.foleysfinest.com/user_avatar/forum.foleysfinest.com/daniel/32/5_2.png) [@daniel](https://forum.foleysfinest.com/u/daniel)
#### Post date: [14 November 2022 10:57 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/12 "2022-11-14T10:57:56Z")

</div>

If you need to see examples, how it was done:  
In the `PluginGuiMagic` repository where you found this EqualizerExample, every project has a `magic.xml` file in the Resources folder. When you load it (it is already loaded when you run the examples) you see the tree in the attached window, just unfold the tree and click some elements. You will get the properties listed in the middle.  
And you can resize the three parts (tree, properties and palette of new items).  
You can also check the “View…” menu to detach the additional window then you can resize it freely.

Hope that helps a bit

---

<div class="post-metadata">

### Author: ![quessada](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/q/a698b9/32.png) [@quessada](https://forum.foleysfinest.com/u/quessada)
#### Post date: [14 November 2022 13:57 UTC](https://forum.foleysfinest.com/t/error-opening-example-files/116/13 "2022-11-14T13:57:40Z")

</div>

Thank youVERY much! Appreciated
