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

IMGUI: Link against -ldl now #2429

Merged
merged 1 commit into from
Jan 19, 2024
Merged

IMGUI: Link against -ldl now #2429

merged 1 commit into from
Jan 19, 2024

Conversation

emminizer
Copy link
Contributor

Something in the recent IMGUI update broke the link command on Linux for my EL7 and EL8 systems for examples. I got errors like the following:

[ 79%] Linking CXX executable ../../../bin/osgearth_imgui
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: CMakeFiles/application_osgearth_imgui.dir/__/__/third_party/imgui/backends/imgui_impl_opengl3.cpp.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: /lib64/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/applications/osgearth_imgui/CMakeFiles/application_osgearth_imgui.dir/build.make:222: bin/osgearth_imgui] Error 1

This patch adds in -ldl wherever IMGUI is linked in, using the existing macro, using the automatically defined CMAKE_DL_LIBS. I tested this on RHEL7 gcc 11.2.1 and on MSVC 2022 x64.

@gwaldron gwaldron merged commit 2f69954 into gwaldron:master Jan 19, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants