Missing CMAKE_DL_LIBS in link interface
JosiahWI opened this issue · 1 comments
JosiahWI commented
cmake_minimum_required(VERSION 3.18)
project(perftest
VERSION 0.0.1
DESCRIPTION "Performance comparison for IrrlichtMt changes"
LANGUAGES CXX
)
find_package(IrrlichtMt REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE IrrlichtMt::IrrlichtMt)
mezhir@Inspiron:~/code/open_contrib/irr_perf_test$ cmake --build build
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mezhir/code/open_contrib/irr_perf_test/build
[1/1] Linking CXX executable main
FAILED: main
: && /usr/bin/c++ -march=native -flto -g CMakeFiles/main.dir/main.cpp.o -o main /home/mezhir/code/open_contrib/irrlicht/build/lib/Linux/libIrrlichtMt.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXxf86vm.so && :
/usr/bin/ld: /home/mezhir/code/open_contrib/irrlicht/build/lib/Linux/libIrrlichtMt.a(CGLXManager.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
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.