magnum-examples icon indicating copy to clipboard operation
magnum-examples copied to clipboard

Unable to build ImGui example using Vcpkg out of the box

Open GeorgeBarlow opened this issue 2 years ago • 6 comments

Hi,

I don't know if I've done something wrong, most likely have, but I'm trying to build this repo after using VCPKG.

  1. I used VCPKG to install the magnum packages and used this command and installed the following libraries and cloned this repo:

    • ./vcpkg install --head corrade magnum magnum-integration imgui
  2. I set CMAKE_TOOLCHAIN_FILE to my VCPKG cmake file in build systems (vcpkg/scripts/buildsystems/vcpkg.cmake) and built the project with only the WITH_IMGUI_EXAMPLE set to ON.

However, after attempting a build, my CMake returns this:

main] Building folder: magnum-examples-master-2 
[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build ~/Downloads/magnum-examples-master/build --config Debug --target all -j 14 --
[build] -- Found Magnum: ~/vcpkg/installed/x64-osx/include   
[build] -- Found Corrade: ~/vcpkg/installed/x64-osx/include  found components: Containers rc Main 
[build] -- Found Corrade: ~/vcpkg/installed/x64-osx/include  found components: Containers rc Utility 
[build] -- Found Magnum: ~/vcpkg/installed/x64-osx/include  found components: GL 
[build] -- Found Magnum: ~/vcpkg/installed/x64-osx/include  found components: GL Shaders 
[cmake] -- Found ImGui: ~/vcpkg/installed/x64-osx/include   
[build] CMake Error at /usr/local/Cellar/cmake/3.21.3_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[build]   Could NOT find MagnumIntegration (missing: ImGui)
[build] 
[build]       Reason given by package: ImGui is not built by default. Make sure you enabled WITH_IMGUI when building Magnum Integration.
[build] 
[build] Call Stack (most recent call first):
[build]   /usr/local/Cellar/cmake/3.21.3_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
[build]   modules/FindMagnumIntegration.cmake:329 (find_package_handle_standard_args)
[build]   ~/vcpkg/scripts/buildsystems/vcpkg.cmake:786 (_find_package)
[build]   src/imgui/CMakeLists.txt:47 (find_package)
[build] 
[build] 
[build] -- Configuring incomplete, errors occurred!
[build] See also "~/Downloads/magnum-examples-master/build/CMakeFiles/CMakeOutput.log".
[build] make: *** [cmake_check_build_system] Error 1
[build] Build finished with exit code 2

Could someone help me understand what I've done wrong. As you can tell I'm using Clang as my compiler and I'm currently running macOS.

Thanks, George

GeorgeBarlow avatar Oct 11 '21 13:10 GeorgeBarlow

magnum-integration doesn't have any default features, so you'll have to be specific about compiling the imgui integration: ./vcpkg install --head corrade magnum magnum-integration[imgui] imgui

pezcode avatar Oct 11 '21 14:10 pezcode

@pezcode Thank you so much, I'm so stupid.

Also if you wouldn't mind helping again, sorry. I keep getting loads of problems with how libSDL2d is linked.

build] Undefined symbols for architecture x86_64:
[build]   "_AudioObjectAddPropertyListener", referenced from:
[build]       _COREAUDIO_Init in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _audioqueue_thread in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioObjectGetPropertyData", referenced from:
[build]       _prepare_device in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _assign_device_to_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _device_unplugged in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _build_device_list in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioObjectGetPropertyDataSize", referenced from:
[build]       _build_device_list in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioObjectRemovePropertyListener", referenced from:
[build]       _COREAUDIO_CloseDevice in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _COREAUDIO_Deinitialize in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _audioqueue_thread in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueAllocateBuffer", referenced from:
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueDispose", referenced from:
[build]       _COREAUDIO_CloseDevice in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueEnqueueBuffer", referenced from:
[build]       _audioqueue_thread in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _inputCallback in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _outputCallback in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueNewInput", referenced from:
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueNewOutput", referenced from:
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueSetProperty", referenced from:
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _assign_device_to_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueStart", referenced from:
[build]       _audioqueue_thread in libSDL2d.a(SDL_coreaudio.m.o)
[build]       _prepare_audioqueue in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_AudioQueueStop", referenced from:
[build]       _audioqueue_thread in libSDL2d.a(SDL_coreaudio.m.o)
[build]   "_CVDisplayLinkCreateWithCGDisplay", referenced from:
[build]       _Cocoa_InitModes in libSDL2d.a(SDL_cocoamodes.m.o)
[build]       _Cocoa_GetDisplayModes in libSDL2d.a(SDL_cocoamodes.m.o)
[build]   "_CVDisplayLinkGetNominalOutputVideoRefreshPeriod", referenced from:
[build]       _GetDisplayModeRefreshRate in libSDL2d.a(SDL_cocoamodes.m.o)
[build]   "_CVDisplayLinkRelease", referenced from:
[build]       _Cocoa_InitModes in libSDL2d.a(SDL_cocoamodes.m.o)
[build]       _Cocoa_GetDisplayModes in libSDL2d.a(SDL_cocoamodes.m.o)
[build]   "_FFCreateDevice", referenced from:
[build]       _DARWIN_JoystickInitRumble in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticOpenFromService in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFDeviceCreateEffect", referenced from:
[build]       _DARWIN_JoystickInitRumble in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticNewEffect in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFDeviceGetForceFeedbackCapabilities", referenced from:
[build]       _GetSupportedFeatures in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFDeviceGetForceFeedbackProperty", referenced from:
[build]       _GetSupportedFeatures in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFDeviceReleaseEffect", referenced from:
[build]       _JoystickDeviceWasRemovedCallback in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticDestroyEffect in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFDeviceSendForceFeedbackCommand", referenced from:
[build]       _DARWIN_JoystickInitRumble in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticOpenFromService in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticPause in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticUnpause in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticStopAll in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFDeviceSetForceFeedbackProperty", referenced from:
[build]       _SDL_SYS_HapticSetGain in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticSetAutocenter in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFEffectGetEffectStatus", referenced from:
[build]       _SDL_SYS_HapticGetEffectStatus in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFEffectSetParameters", referenced from:
[build]       _DARWIN_JoystickRumble in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticUpdateEffect in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFEffectStart", referenced from:
[build]       _DARWIN_JoystickRumble in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticRunEffect in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFEffectStop", referenced from:
[build]       _SDL_SYS_HapticStopEffect in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFIsForceFeedback", referenced from:
[build]       _JoystickDeviceWasAddedCallback in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _MacHaptic_MaybeAddDevice in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_FFReleaseDevice", referenced from:
[build]       _JoystickDeviceWasRemovedCallback in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]       _SDL_SYS_HapticOpenFromService in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticClose in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IODisplayCreateInfoDictionary", referenced from:
[build]       _Cocoa_GetDisplayName in libSDL2d.a(SDL_cocoamodes.m.o)
[build]   "_IOHIDDeviceCopyMatchingElements", referenced from:
[build]       _GetDeviceInfo in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDDeviceGetProperty", referenced from:
[build]       _GetDeviceInfo in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDDeviceGetService", referenced from:
[build]       _JoystickDeviceWasAddedCallback in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDDeviceGetValue", referenced from:
[build]       _GetHIDElementState in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDDeviceRegisterRemovalCallback", referenced from:
[build]       _JoystickDeviceWasAddedCallback in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDDeviceScheduleWithRunLoop", referenced from:
[build]       _JoystickDeviceWasAddedCallback in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDDeviceUnscheduleFromRunLoop", referenced from:
[build]       _FreeDevice in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetChildren", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetCookie", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetLogicalMax", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetLogicalMin", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetType", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetTypeID", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetUsage", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDElementGetUsagePage", referenced from:
[build]       _AddHIDElement in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerClose", referenced from:
[build]       _DARWIN_JoystickQuit in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerCreate", referenced from:
[build]       _CreateHIDManager in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerOpen", referenced from:
[build]       _ConfigHIDManager in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerRegisterDeviceMatchingCallback", referenced from:
[build]       _ConfigHIDManager in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerScheduleWithRunLoop", referenced from:
[build]       _ConfigHIDManager in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerSetDeviceMatchingMultiple", referenced from:
[build]       _ConfigHIDManager in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDManagerUnscheduleFromRunLoop", referenced from:
[build]       _DARWIN_JoystickQuit in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOHIDValueGetIntegerValue", referenced from:
[build]       _GetHIDElementState in libSDL2d.a(SDL_iokitjoystick.c.o)
[build]   "_IOIteratorIsValid", referenced from:
[build]       _SDL_SYS_HapticInit in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOIteratorNext", referenced from:
[build]       _SDL_SYS_HapticInit in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOObjectIsEqualTo", referenced from:
[build]       _MacHaptic_MaybeAddDevice in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _MacHaptic_MaybeRemoveDevice in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_JoystickSameHaptic in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticOpenFromJoystick in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOObjectRelease", referenced from:
[build]       _SDL_SYS_HapticInit in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _HIDGetDeviceProduct in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _MacHaptic_MaybeRemoveDevice in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _SDL_SYS_HapticQuit in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOObjectRetain", referenced from:
[build]       _MacHaptic_MaybeAddDevice in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOPMAssertionCreateWithDescription", referenced from:
[build]       _Cocoa_SuspendScreenSaver in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_IOPMAssertionRelease", referenced from:
[build]       _Cocoa_SuspendScreenSaver in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_IOPSCopyPowerSourcesInfo", referenced from:
[build]       _SDL_GetPowerInfo_MacOSX in libSDL2d.a(SDL_syspower.c.o)
[build]   "_IOPSCopyPowerSourcesList", referenced from:
[build]       _SDL_GetPowerInfo_MacOSX in libSDL2d.a(SDL_syspower.c.o)
[build]   "_IOPSGetPowerSourceDescription", referenced from:
[build]       _SDL_GetPowerInfo_MacOSX in libSDL2d.a(SDL_syspower.c.o)
[build]   "_IORegistryEntryCreateCFProperties", referenced from:
[build]       _MacHaptic_MaybeAddDevice in libSDL2d.a(SDL_syshaptic.c.o)
[build]       _HIDGetDeviceProduct in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IORegistryEntryGetParentEntry", referenced from:
[build]       _HIDGetDeviceProduct in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOServiceGetMatchingServices", referenced from:
[build]       _SDL_SYS_HapticInit in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_IOServiceMatching", referenced from:
[build]       _SDL_SYS_HapticInit in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_KBGetLayoutType", referenced from:
[build]       _Cocoa_HandleKeyEvent in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]   "_LMGetKbdType", referenced from:
[build]       _UpdateKeymap in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]       _Cocoa_HandleKeyEvent in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]   "_MTLCreateSystemDefaultDevice", referenced from:
[build]       _METAL_CreateRenderer in libSDL2d.a(SDL_render_metal.m.o)
[build]   "_NSApp", referenced from:
[build]       _Cocoa_SetWindowIcon in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _Cocoa_RaiseWindow in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _Cocoa_FlashWindow in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[SDLAppDelegate dealloc] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       -[SDLAppDelegate windowWillClose:] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       -[SDLAppDelegate focusSomeWindow:] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       -[SDLAppDelegate applicationDidFinishLaunching:] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       ...
[build]      (maybe you meant: __OBJC_LABEL_PROTOCOL_$_NSApplicationDelegate, __OBJC_PROTOCOL_$_NSApplicationDelegate )
[build]   "_NSAppKitVersionNumber", referenced from:
[build]       _Cocoa_VideoInit in libSDL2d.a(SDL_cocoavideo.m.o)
[build]       _Cocoa_CreateWindow in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _Cocoa_SetWindowFullscreen in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _is_macos11 in libSDL2d.a(SDL_mfijoystick.m.o)
[build]       _Cocoa_GL_CreateContext in libSDL2d.a(SDL_cocoaopengl.m.o)
[build]       _GetDisplayMode in libSDL2d.a(SDL_cocoamodes.m.o)
[build]       _Cocoa_GetDisplayModes in libSDL2d.a(SDL_cocoamodes.m.o)
[build]       ...
[build]   "_NSApplicationDidBecomeActiveNotification", referenced from:
[build]       -[SDLAppDelegate init] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       -[SDLAppDelegate dealloc] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_NSBackingPropertyOldScaleFactorKey", referenced from:
[build]       -[Cocoa_WindowListener windowDidChangeBackingProperties:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSDeviceRGBColorSpace", referenced from:
[build]       _Cocoa_CreateImage in libSDL2d.a(SDL_cocoavideo.m.o)
[build]   "_NSFilenamesPboardType", referenced from:
[build]       -[SDLWindow performDragOperation:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSPasteboardTypeString", referenced from:
[build]       _Cocoa_SetClipboardText in libSDL2d.a(SDL_cocoaclipboard.m.o)
[build]       _Cocoa_GetClipboardText in libSDL2d.a(SDL_cocoaclipboard.m.o)
[build]   "_NSRectFill", referenced from:
[build]       -[SDLView drawRect:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _Cocoa_SetWindowShape in libSDL2d.a(SDL_cocoashape.m.o)
[build]   "_NSWindowDidBecomeKeyNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidChangeBackingPropertiesNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidDeminiaturizeNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidEnterFullScreenNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidExitFullScreenNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidExposeNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidMiniaturizeNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidMoveNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidResignKeyNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowDidResizeNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowWillCloseNotification", referenced from:
[build]       -[SDLAppDelegate init] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       -[SDLAppDelegate dealloc] in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_NSWindowWillEnterFullScreenNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_NSWindowWillExitFullScreenNotification", referenced from:
[build]       -[Cocoa_WindowListener listen:] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       -[Cocoa_WindowListener close] in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_OBJC_CLASS_$_MTLRenderPassDescriptor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_render_metal.m.o)
[build]   "_OBJC_CLASS_$_MTLRenderPipelineDescriptor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_render_metal.m.o)
[build]   "_OBJC_CLASS_$_MTLSamplerDescriptor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_render_metal.m.o)
[build]   "_OBJC_CLASS_$_MTLTextureDescriptor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_render_metal.m.o)
[build]   "_OBJC_CLASS_$_MTLVertexDescriptor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_render_metal.m.o)
[build]   "_OBJC_CLASS_$_NSAlert", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoamessagebox.m.o)
[build]   "_OBJC_CLASS_$_NSApplication", referenced from:
[build]       _OBJC_CLASS_$_SDLApplication in libSDL2d.a(SDL_cocoaevents.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_CLASS_$_NSBezierPath", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoashape.m.o)
[build]   "_OBJC_CLASS_$_NSBitmapImageRep", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoavideo.m.o)
[build]   "_OBJC_CLASS_$_NSColor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoashape.m.o)
[build]   "_OBJC_CLASS_$_NSCursor", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoamouse.m.o)
[build]       __OBJC_$_CATEGORY_NSCursor_$_InvisibleCursor in libSDL2d.a(SDL_cocoamouse.m.o)
[build]   "_OBJC_CLASS_$_NSEvent", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoamouse.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_CLASS_$_NSGraphicsContext", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoashape.m.o)
[build]   "_OBJC_CLASS_$_NSImage", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoavideo.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoamouse.m.o)
[build]   "_OBJC_CLASS_$_NSMenu", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_CLASS_$_NSMenuItem", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_CLASS_$_NSOpenGLContext", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _OBJC_CLASS_$_SDLOpenGLContext in libSDL2d.a(SDL_cocoaopengl.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaopengl.m.o)
[build]   "_OBJC_CLASS_$_NSOpenGLPixelFormat", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaopengl.m.o)
[build]   "_OBJC_CLASS_$_NSPasteboard", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaclipboard.m.o)
[build]   "_OBJC_CLASS_$_NSResponder", referenced from:
[build]       _OBJC_CLASS_$_Cocoa_WindowListener in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_OBJC_CLASS_$_NSRunningApplication", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_CLASS_$_NSScreen", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoamodes.m.o)
[build]   "_OBJC_CLASS_$_NSView", referenced from:
[build]       _OBJC_CLASS_$_SDLView in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _OBJC_CLASS_$_SDLTranslatorResponder in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]       _OBJC_CLASS_$_SDL_cocoametalview in libSDL2d.a(SDL_cocoametalview.m.o)
[build]   "_OBJC_CLASS_$_NSWindow", referenced from:
[build]       _OBJC_CLASS_$_SDLWindow in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       objc-class-ref in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_CLASS_$_NSWorkspace", referenced from:
[build]       objc-class-ref in libSDL2d.a(SDL_sysurl.m.o)
[build]   "_OBJC_METACLASS_$_NSApplication", referenced from:
[build]       _OBJC_METACLASS_$_SDLApplication in libSDL2d.a(SDL_cocoaevents.m.o)
[build]   "_OBJC_METACLASS_$_NSOpenGLContext", referenced from:
[build]       _OBJC_METACLASS_$_SDLOpenGLContext in libSDL2d.a(SDL_cocoaopengl.m.o)
[build]   "_OBJC_METACLASS_$_NSResponder", referenced from:
[build]       _OBJC_METACLASS_$_Cocoa_WindowListener in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_OBJC_METACLASS_$_NSView", referenced from:
[build]       _OBJC_METACLASS_$_SDLView in libSDL2d.a(SDL_cocoawindow.m.o)
[build]       _OBJC_METACLASS_$_SDLTranslatorResponder in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]       _OBJC_METACLASS_$_SDL_cocoametalview in libSDL2d.a(SDL_cocoametalview.m.o)
[build]   "_OBJC_METACLASS_$_NSWindow", referenced from:
[build]       _OBJC_METACLASS_$_SDLWindow in libSDL2d.a(SDL_cocoawindow.m.o)
[build]   "_TISCopyCurrentKeyboardLayoutInputSource", referenced from:
[build]       _UpdateKeymap in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]   "_TISGetInputSourceProperty", referenced from:
[build]       _UpdateKeymap in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build]   "_iconv", referenced from:
[build]       _SDL_iconv_REAL in libSDL2d.a(SDL_iconv.c.o)
[build]      (maybe you meant: _SDL_iconv_REAL, _SDL_iconv_open_REAL , _SDL_iconv_string , _SDL_iconv_close , _SDL_iconv_close_REAL , _SDL_iconv_open , _SDL_iconv_string_REAL , _SDL_iconv )
[build]   "_iconv_close", referenced from:
[build]       _SDL_iconv_close_REAL in libSDL2d.a(SDL_iconv.c.o)
[build]      (maybe you meant: _SDL_iconv_close, _SDL_iconv_close_REAL )
[build]   "_iconv_open", referenced from:
[build]       _SDL_iconv_open_REAL in libSDL2d.a(SDL_iconv.c.o)
[build]      (maybe you meant: _SDL_iconv_open_REAL, _SDL_iconv_open )
[build]   "_kIOMasterPortDefault", referenced from:
[build]       _SDL_SYS_HapticInit in libSDL2d.a(SDL_syshaptic.c.o)
[build]   "_kTISPropertyUnicodeKeyLayoutData", referenced from:
[build]       _UpdateKeymap in libSDL2d.a(SDL_cocoakeyboard.m.o)
[build] ld: symbol(s) not found for architecture x86_64

Have you ever seen this before or know if I'm once again doing something even more stupid.

Thanks

GeorgeBarlow avatar Oct 11 '21 14:10 GeorgeBarlow

Those I have no idea about, sorry. It seems to not be linking the required macOS SDK libraries, but beyond that I'd be wildly guessing.

pezcode avatar Oct 11 '21 14:10 pezcode

I've found the issue, it's not finding the SDL2 package. After using find_package(SDL2 CONFIG REQUIRED) in the ImGui integration CMakeLists.txt it fixes it.

I'll try see if I can update the FindSDL2.cmake file as this seems to be where the problem lies.

GeorgeBarlow avatar Oct 11 '21 14:10 GeorgeBarlow

Hi!

I'm just checking FindSDL2.cmake and it's somehow not taking into account the actual SDL cmake config file. Most other Find modules in Magnum do that, this one not for some reason. I'll try to update the find module and give you a patch to test. Just curious, in the build log, is there something like the following?

[build] -- Found SDL2: <some path>

It'd help me to know what does it say there. Thanks!

mosra avatar Oct 11 '21 14:10 mosra

It seems the following could be enough for Magnum's FindSDL2.cmake to make it prefer the installed config (and thus use it to get all static dependencies on macOS). Can you confirm that for me? Thanks!

diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake
index 54844d696..47a70a8f8 100644
--- a/modules/FindSDL2.cmake
+++ b/modules/FindSDL2.cmake
@@ -42,10 +42,21 @@
 #   DEALINGS IN THE SOFTWARE.
 #
 
-# If we have a CMake subproject, use the targets directly. I'd prefer the
-# static variant, however SDL2 defines its own SDL2::SDL2 alias for only the
-# dynamic variant since https://github.com/libsdl-org/SDL/pull/4074 and so I'm
-# forced to use that, if available.
+# SDL installs cmake package config files that handle platform-specific
+# dependencies, especially in case it's built statically. Try to find it first,
+# quietly, so it doesn't print loud messages if the config file is not found,
+# since that's okay (an installed package might not have the CMake files at
+# all, for example). If some SDL target already exists, it means we're using it
+# through a CMake subproject -- don't attempt to find the package in that case.
+if(NOT TARGET SDL2 AND NOT TARGET SDL2-static)
+    find_package(SDL2 CONFIG QUIET)
+endif()
+
+# If either a SDL target was found or we have a CMake subproject, use the
+# targets directly. I'd prefer the static variant, however SDL2 defines its own
+# SDL2::SDL2 alias for only the dynamic variant since
+# https://github.com/libsdl-org/SDL/pull/4074 and so I'm forced to use that, if
+# available.
 if(TARGET SDL2)
     # In case we don't have https://github.com/libsdl-org/SDL/pull/4074 yet,
     # do the alias ourselves.

Just to clear things up -- it shouldn't be needed to update anything in the ImGui integration itself, it's independent on SDL. On the other hand I'm a bit suspicious that vcpkg injects its own FindSDL2 variant, because Magnum's variant does have handling for macOS dependencies (although it could be broken for this particular use case, of course): https://github.com/mosra/magnum/blob/d96957b5a4198f288d306775e06c80e69928012b/modules/FindSDL2.cmake#L177-L211

mosra avatar Oct 11 '21 15:10 mosra