cmake_minimum_required(VERSION 3.13)
project(fillit C)
set(CMAKE_C_STANDARD 99)
add_executable(fillit
src/main.c
src/sort_list.c
src/reader.c
src/validator.c
src/solver.c)
# includes external header files
target_include_directories(fillit PRIVATE
${CMAKE_SOURCE_DIR}/libft/includes)
# Links libraries
target_link_libraries(fillit
${CMAKE_SOURCE_DIR}/libft/libft.so)
这是我的CMAKE,但是在链接静态库时,似乎工作得很好,每当我尝试链接同一库但动态链接时,就会出现以下错误。
dyld: Library not loaded: libft.so
Referenced from: /Users/dvan-boc/Desktop/fillit/build/./fillit
Reason: image not found