Can not resolve JucePlugin_Name from example AudioPlugin project

Hello there, when trying to get JUCE/examples/CMake/AudioPlugin running, I came across the issue to not being able to resolve JucePlugin_Name from PluginProcessor.cpp’s getName() function.
I have not modified anything at all except the CMakeLists.txt which looks like this:

cmake_minimum_required(VERSION 3.22)

project(AUDIO_PLUGIN_EXAMPLE VERSION 0.0.1)

set(JUCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/JUCE")
add_subdirectory("${JUCE_PATH}")

juce_add_plugin(AudioPluginExample
    PLUGIN_MANUFACTURER_CODE Juce
    PLUGIN_CODE Dem0                            
    FORMATS AU VST3 Standalone                  
    PRODUCT_NAME "Audio Plugin Example")        

target_sources(AudioPluginExample
    PRIVATE
        source/PluginEditor.cpp
        source/PluginProcessor.cpp)

target_compile_definitions(AudioPluginExample
    PUBLIC
        JUCE_WEB_BROWSER=0  
        JUCE_USE_CURL=0     
        JUCE_VST3_CAN_REPLACE_VST2=0)


target_link_libraries(AudioPluginExample
    PRIVATE
        juce::juce_audio_utils
    PUBLIC
        juce::juce_recommended_config_flags
        juce::juce_recommended_lto_flags
        juce::juce_recommended_warning_flags)

What i’ve tried:

  1. Adding a PLUGIN_NAME within juce_add_plugin()
  2. including “JucePluginDefines.h” (also version with <>) at the top of AudioProcessor.cpp

Please prevent me from smashing my head against a wall.
Appreciated :slight_smile:

Try removing the spaces from PRODUCT_NAME, delete your old build directory, and try again.

What’s the exact text of the error that you’re seeing? Is it a build error, or a static-analysis/linting error?

Hello reuk, the error I am seeing when hovering over “JucePlugin_Name” says:
“JucePlugin_Name” is not defined.

When trying to include “JucePluginDefines.h” the error from running
cmake --build build says:
“fatal error C1083: Cannot open include file: “JucePluginDefines.h”: No such file or directory”

I Configured via: cmake -B build -G “Visual Studio 16 2019”

Does it build successfully if you remove the “JucePluginDefines.h” include (i.e. revert the C++ source back to the original state) and use the CMakeLists that you originally posted?

It does build successfully and i got the standalone running, my IDE still shows the error though so I suppose it is an issue with the IDE.

I’ll look for a way to test the getName() function just to make sure

No luck, though the build is successfull when removing JucePluginDefines.h
still gives me a linter error though.

Hey wanted to let you know that processor.getName() works fine and successfully outputs the plugin name when substituting “Hello World” for it, even though there is a linter error in the IDE.

Thank you for your help, I can now start actually learning the framework :grinning_face_with_smiling_eyes: