Projucer to CMake, weird link error

Hello! I’m switching from the Projucer to CMake and I’m getting a weird link error that I don’t know how to solve.
I never had any issue building my project with the Projucer/XCode/Clang and I have other projects on my machine I have no trouble building with CMake.

After fixing many build errors due to the transition, I now get a link error that I have no idea how to solve, specifically:

2022-12-17 15:30:38.219 xcodebuild[1273:14349] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in
2022-12-17 15:30:38.219 xcodebuild[1273:14349] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in
ld: library not found for -lmany
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I Googled and found similar issues, with different libraries, but can’t find anything about this “lmany”. Also weird that the missing stuff seems related to WatchOS(?).

I tried a bit of everything the first few Google pages suggest, but with no success. These attempts include:

  • Reinstalling the Command Tools
  • Clean reinstalling XCode
  • Building the project on another machine, but getting the same error (this makes me think the issue is specific of my project).
  • Having JUCE as subdirectory and globally installed + find_package()

If it can help, I’m on:

  • MacOS 12.2.1
  • CMake 3.25.1
  • Xcode 13.4.1
  • Clang 13.1.6

and my project looks something like

    CMakeLists.txt          root CMakeLists, where I set minimum CMake version, create a main project(JACOPO_MAIN_PROJECT VERSION 0.0.1) and add_subdirectory() submodules/JUCE., common/ and projects/

    build/                  where I have the cmake builds

        CMakeLists.txt      just add_subdirectory(src)
                and a bunch of .h and .cpp for custom GUI stuff
                and a bunch of .h and .cpp for custom DSP stuff
                and a bunch of .h and .cpp for custom service stuff (like license check and preset manager)

        CMakeLists.txt      just add_subdirectory(project1)

            CMakeLists.txt  the main CMakeLists for this specific plugin with a project(Plugin1 VERSION 0.0.1) and the rest set up similarly to the AudioPlugin example in JUCE/examples/CMake.
            assets/         where I have the plugin assets, added via juce_add_binary_data() and linked to the main Plugin1 project.


Anyone had similar issues? I’m completely stuck on this one.
The thing I’m mostly insecure about is having a main project(JACOPO_MAIN_PROJECT VERSION 0.0.1) and a separate project(Plugin1 VERSION 0.0.1) for the plugin, but I don’t see how this can create linking issues.

If I try to go back to my Projucer branch, interestingly enough, I can’t build anymore because I’m missing C++ 17!?

What does your CMake look like? Somewhere you probably have something along the lines of target_link_libraries(<yourTarget> PRIVATE many)

I think I just managed to find the issue. In the jacopo_dsp juce module I created, I wrote, temporarily

dependencies: many juce ones

thinking it was not actually used to inform the linker, but only as reference for the user.
I should stop thinking, that seems to be the cause of all the problems :sweat_smile:

Thank you for the support!

1 Like