Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ImGui dependency on ApplicationServices once 1.72b is widely used enough #48

Closed
AboudFayad opened this issue Jul 14, 2019 · 8 comments
Milestone

Comments

@AboudFayad
Copy link

I am trying to build the magnum integration with imgui on mac, but the build always fails with the following error:

Undefined symbols for architecture x86_64:
  "_CFArrayGetCount", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_CFDataCreate", referenced from:
      SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
  "_CFDataGetBytes", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_CFDataGetLength", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_CFRelease", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
      SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
  "_PasteboardClear", referenced from:
      SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
  "_PasteboardCopyItemFlavorData", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_PasteboardCopyItemFlavors", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_PasteboardCreate", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
      SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
  "_PasteboardGetItemCount", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_PasteboardGetItemIdentifier", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "_PasteboardPutItemFlavor", referenced from:
      SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
  "_PasteboardSynchronize", referenced from:
      GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
  "___CFConstantStringClassReference", referenced from:
      CFString in imgui.cpp.o
      CFString in imgui.cpp.o
  "_kCFAllocatorDefault", referenced from:
      SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/Magnum/ImGuiIntegration/libMagnumImGuiIntegration.2.2.dylib] Error 1
make[1]: *** [src/Magnum/ImGuiIntegration/CMakeFiles/MagnumImGuiIntegration.dir/all] Error 2
make: *** [all] Error 2

which are windows specific functions, I tried building it on windows the same way I did on mac and it worked. So I believe it is a mac specific issue.

Anyway to overcome this issue?

@mosra mosra mentioned this issue Jul 14, 2019
60 tasks
@mosra
Copy link
Owner

mosra commented Jul 14, 2019

Hi, sorry about this. The integration code was not yet upgraded to work with latest ImGui versions and this seems to be caused by new macOS clipboard support in 1.71 (ocornut/imgui#2546). Until I fix this and link the missing framework, can you build with an older version of ImGui? The code was tested extensively with 1.69, 1.70 could work too.

@mosra mosra added this to the 2019.0b milestone Jul 14, 2019
@AboudFayad
Copy link
Author

Thanks a lot, 1.69 works just fine.

@melix99
Copy link
Contributor

melix99 commented Jul 19, 2019

If there is a need to use the latest version of imgui you can add the Carbon library to your CMakeLists and that should fix the error:

if(APPLE)
    find_library(CARBON_LIBRARY Carbon)
endif()

# Add ${CARBON_LIBRARY} to your target_link_libraries()

EDIT:
Or even better: just add "-framework ApplicationServices" to target_link_libraries()

@mosra
Copy link
Owner

mosra commented Jul 20, 2019

Should be fixed with b157344 -- to make it work, please update the FindImGui.cmake copy in your projects.

@ocornut
Copy link

ocornut commented Jul 22, 2019

Note as as-per ocornut/imgui@29d9394 and ocornut/imgui#2546 (comment) I have reverted this change. It is possible to explicitely enabled the default cocoa handler by using IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS, as a facility for custom engine writers on the Mac.

@ocornut
Copy link

ocornut commented Jul 22, 2019

....That wasn't explicit in the message above, but it means you may revert linking to ApplicationServices... Magnum probably has its own clipboard handler anyway.

@mosra
Copy link
Owner

mosra commented Jul 22, 2019

@ocornut thanks a lot for taking the time to comment! 💚

I'll keep it around for now so people using 1.71 don't run into the same issue again, will remove it a few releases later.

@mosra mosra reopened this Jul 22, 2019
@mosra mosra changed the title Magnum ImGui integration not working on mac os ImGui 1.71 needs to link to ApplicationServices on macOS Jul 22, 2019
@mosra mosra removed this from the 2019.0b milestone Jul 22, 2019
@mosra mosra added this to the 2019.0c milestone Oct 7, 2019
@mosra mosra modified the milestones: 2020.06, 2020.0b Jun 26, 2020
@mosra mosra changed the title ImGui 1.71 needs to link to ApplicationServices on macOS Remove ImGui dependency on ApplicationServices once 1.72b is widely used enough Jun 26, 2020
@mosra
Copy link
Owner

mosra commented Feb 8, 2022

I decided to just link to ApplicationServices always, as it's no additonal hurdle on our side and it's nicer to users. Internal TODO removed in 4e99409.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants