I’ve put this in the Linux section since I’m running Ubuntu 20.04, but feel free to move this if it belongs somewhere else. I hit a wall a while back teaching myself via the tutorials and some youtube videos, and now I’m trying to dive back in. Unfortunately, I can’t even get a basic project to compile; maybe someone here can help with what might be an easy/obvious fix for someone who knows what they’re doing?
I got the most recent version of the projucer, started a new plugin project, named it “Monotonicizer”, set the exporter to CodeBlocks, and then saved the project. Next I opened that project in CodeBlocks and hit compile. I get an error:
error: ‘Monotonicizer’ was not declared in this scope
beneath that, it says
note: in expansion of macro ‘JucePlugin_Name’
which takes me to line 34, which is the return statement in this function in the PluginProcessor.cpp file:
in “JucePluginDefines.h” in the JuceLibraryCode folder. That error message makes it sound like somehow the plugin name is not being quoted properly. What does the definition of JucePlugin_Name look like?
Yeah, everything looks right there. Not sure what the issue might be, then!
FWIW I just created a default plug-in project with the same name on MacOS, that looks identical to the code snippets you’ve posted here, and it builds without issue.
I wonder if it’s an issue related to CodeBlocks or its exporter – you might try adding a Makefile exporter and see if the project will build using make?
Thanks again for the reply, sorry that I didn’t think to try that right away. Compiling via the Makefile completed successfully. Is it likely I’ve misconfigured something in CodeBlocks somewhere along the way? Could this be an issue with how the Projucer generates the CodeBlocks project? Should I take this to CodeBlocks forums?
No worries – that’s what the forum’s here for! I doubt it’s an issue with your exporter configuration, unless of course you’ve redefined JucePlugin_Name somewhere, but that seems doubtful…
I’m not sure if it’s an issue with the Projucer CodeBlocks generator, or if it’s an issue with CodeBlocks itself. To make sure that the quotes are in fact the source of the error, could you try adding this macro to your code:
If missing quotes are indeed the issue, this workaround should cause the CodeBlocks build to succeed. Not really a solution, but should at least verify the cause of the issue.
Thanks for raising this. It looks like the Projucer CodeBlocks generator wasn’t escaping some plugin definitions properly. This patch should fix the issue:
To use this, you’ll need to checkout the latest develop, rebuild the Projucer, then use this new Projucer to resave your project.
Hello. I Am having a similar problem. I extracted the latest Juce Zip (6.0.5) on Ubuntu 20.04. Ran Projucer and set up the global paths.
Then I tried to build a “basic” plugin and opened it in Codeblocks and get the same error as Jlmoriart
OK I dont even know how to do that but ill look into it, thanks. So if I clone the develop branch it will update on its own? or do I have to run an update on it?
you do not have to update it. cloning a repository copies the latest versions of all the files. you will need to build the projucer, but otherwise it is ready to go. at a later date if you want to make sure you have the latest code, you will execute the git pull command from anywhere in the JUCE folder hierarchy. for consistency sake, you should rebuild the projucer whenever you pull new code.
Thanks. Im trying to build the Projucer using the makefile in the development branch (via cd to folder and “make” in terminal) but its giving me a shared library, not an executable. Sorry im not used to linux yet and I might be doing something stupid here. Is this the correct method?