Subject: Need Help Compiling and Executing Visual Studio Plugin on Linux Using CMake

Hello guys

I’m currently a student at the University of Valencia, working on a project that involves compiling and executing a plugin originally developed in Visual Studio, but now I need to adapt it to run on Linux using CMake. I’ve encountered a few issues during this process and would greatly appreciate some guidance.

To provide some context, I have already created the necessary CMakeLists.txt files and have all the plugin processors, as well as editor .cpp and .h files ready. However, I’m encountering difficulties when trying to compile and execute the plugin on a Linux system.

Here’s a summary of what I’ve done so far:

  1. CMakeLists.txt Setup: I’ve created CMakeLists.txt files to define the project structure, dependencies, and compilation instructions. However, I’m unsure if I’ve configured them correctly to ensure the successful compilation and execution of the plugin.
  2. Plugin Adaptation: I’ve made necessary changes to the original Visual Studio project to make it compatible with Linux, such as adjusting file paths, resolving platform-specific dependencies, and updating compiler directives. Despite these adjustments, I’m still facing errors during compilation.
  3. Compilation Errors: When attempting to compile the project using CMake, I encounter various errors related to header file inclusion, linker issues, and compatibility problems with Linux libraries. Specifically, I’m receiving the following error message:

bash

/usr/bin/ld: CMakeFiles/NeuralNetwork_VST3.dir/__/libs/JUCE/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp.o: en la función `juce::createPluginFilterOfType(juce::AudioProcessor::WrapperType)':
juce_audio_plugin_client_VST3.cpp:(.text._ZN4juce24createPluginFilterOfTypeENS_14AudioProcessor11WrapperTypeE[_ZN4juce24createPluginFilterOfTypeENS_14AudioProcessor11WrapperTypeE]+0x3a): referencia a `createPluginFilter()' sin definir
collect2: error: ld returned 1 exit status
make[2]: *** [plugin/CMakeFiles/NeuralNetwork_VST3.dir/build.make:212: plugin/NeuralNetwork_artefacts/VST3/NeuralNetworkPlugin.vst3/Contents/x86_64-linux/NeuralNetworkPlugin.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:222: plugin/CMakeFiles/NeuralNetwork_VST3.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

However, I’ve verified that the createPluginFilter() function is indeed defined in my PluginProcessor.cpp file:

cpp

// This creates new instances of the plugin..
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
    return new NeuralNetworkPluginAudioProcessor();
}

It seems that despite the function being defined, the linker is unable to find it during the compilation process.

I believe that with some guidance from more experienced developers, I can overcome these obstacles and successfully compile and execute the plugin on Linux. If anyone has experience with similar projects or suggestions on how to tackle these issues, I would be immensely grateful for your insights.

Thank you in advance for your help and support.

The error you’re seeing indicates that the final plugin binary doesn’t contain a definition of createPluginFilter. This could be because the file that contains createPluginFilter isn’t compiled at all; or because it’s built into a different target that isn’t linked into the plugin.

You could try putting an #error inside the definition of createPluginFilter(). Then, if the error is hit during the build, you’ll know whether the definition of createPluginFilter is seen by the compiler. If it is, you probably have a link issue.

It’s also a good idea to check for differences between your project and the CMake plugin example in the JUCE repo at examples/CMake/AudioPlugin. The build issues may be due to any such differences.

1 Like