BR: Plugin-VST3 Host fails to link

On the latest develop, building any VST3 plugin that has the JUCE_PLUGINHOST_VST3=1 flag will fail to link.
This is on the latest Xcode, using CMake on an M1 mac, using the Unix Makefiles generator.

Building standalone works, and building VST3 without the flag works.

Exact error message is:

Undefined symbols for architecture arm64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64

The target that fails to link is juce_vst3_helper and not the plugin itself.

Will be great if someone can take a look.

Thanks for reporting, that’s fixed here:

2 Likes

I’m still having issues, but the helper is now building. Looks like a simple path issue, maybe VSCode gets a different build path? To fix it, I did this temporarily:

--- a/extras/Build/CMake/JUCEUtils.cmake
+++ b/extras/Build/CMake/JUCEUtils.cmake
@@ -1034,7 +1034,7 @@ function(_juce_set_plugin_target_properties shared_code_target kind)
             add_custom_command(TARGET ${target_name} POST_BUILD
                 COMMAND ${CMAKE_COMMAND} -E remove -f "${output_path}/Contents/moduleinfo.json"
                 COMMAND ${CMAKE_COMMAND} -E make_directory "${output_path}/Contents/Resources"
-                COMMAND juce_vst3_helper
+                COMMAND "${CMAKE_CURRENT_BINARY_DIR}/juce_vst3_helper"
                     -create
                     -version "${target_version_string}"
                     -path "${output_path}"

This fix looks good here, thank you for the speedy response @reuk!