由于未定义对符号“dlclose@@GLIBC_2.2.5”的引用,无法构建 imgui 应用程序
我正在尝试使用 Dear ImGui 构建非常简单的应用程序。
我将一些 Dear ImGui 文件复制到我的源目录中,并使用 CMake 进行编译,如下所示。
cmake_minimum_required(VERSION 3.12)
project(imgui)
find_package(GLEW REQUIRED)
find_package(glfw3 REQUIRED)
find_package(OpenGL REQUIRED)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(min
min.cpp
${CMAKE_SOURCE_DIR}/imgui.cpp
${CMAKE_SOURCE_DIR}/imgui_demo.cpp
${CMAKE_SOURCE_DIR}/imgui_draw.cpp
${CMAKE_SOURCE_DIR}/imgui_tables.cpp
${CMAKE_SOURCE_DIR}/imgui_widgets.cpp
${CMAKE_SOURCE_DIR}/imgui_impl_opengl3.cpp
${CMAKE_SOURCE_DIR}/imgui_impl_glfw.cpp
)
target_link_libraries(min
glfw
GLEW
GL
#${CMAKE_DL_LIBS} <If this command is used, build successfully!>
)
但我收到以下错误。
-- Configuring done
-- Generating done
-- Build files have been written to: /home/harumo/program/cpp/imgui/minimal/build
[ 11%] Linking CXX executable min
/usr/bin/ld: CMakeFiles/min.dir/imgui_impl_opengl3.cpp.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/min.dir/build.make:189: min] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/min.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
如果您需要任何其他信息,请告诉我。
提前致谢!
I am trying to build very simple application with Dear ImGui.
I copied some Dear ImGui files to my source directory and I compiled with CMake as follows.
cmake_minimum_required(VERSION 3.12)
project(imgui)
find_package(GLEW REQUIRED)
find_package(glfw3 REQUIRED)
find_package(OpenGL REQUIRED)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(min
min.cpp
${CMAKE_SOURCE_DIR}/imgui.cpp
${CMAKE_SOURCE_DIR}/imgui_demo.cpp
${CMAKE_SOURCE_DIR}/imgui_draw.cpp
${CMAKE_SOURCE_DIR}/imgui_tables.cpp
${CMAKE_SOURCE_DIR}/imgui_widgets.cpp
${CMAKE_SOURCE_DIR}/imgui_impl_opengl3.cpp
${CMAKE_SOURCE_DIR}/imgui_impl_glfw.cpp
)
target_link_libraries(min
glfw
GLEW
GL
#${CMAKE_DL_LIBS} <If this command is used, build successfully!>
)
But I got following error.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/harumo/program/cpp/imgui/minimal/build
[ 11%] Linking CXX executable min
/usr/bin/ld: CMakeFiles/min.dir/imgui_impl_opengl3.cpp.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/min.dir/build.make:189: min] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/min.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
If you have any other information you need, please let me know.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论