Closed kershnerd closed 5 years ago
Could you add your solution to this issue?
Yes.. the problem was that I was linking to the dynamic libraries of GLFW. I needed to link to the static libraries.
So for example, in the CMakeLIsts.txt file, I need to do this:
# GLFW
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
include_directories(${GLFW_INCLUDE_DIRS})
# Vulkan
find_package(Vulkan REQUIRED)
# Add your executables here
add_executable(example1 main.cpp)
# linker
target_link_libraries(example1 ${GLFW_STATIC_LIBRARIES} ${Vulkan_LIBRARIES})
Here is my CMakeLists.txt:
I am getting the follow error when linking:
I think this is relating to needing the link with
-ldl
but not sure how to do that in a CMakeLists.txt. I tried this but it didn't work:Any ideas?