CMake: Run-time error (dyld: Library not loaded) for dynamically linked resources on MacOS

后端 未结 2 1703
野的像风
野的像风 2020-12-19 08:20

Problem

On MacOS, I get linking problems at runtime for a CMake project that depends on dynamically linked resources – but only after installing the project! The p

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 08:29

    This fixed the issue for me:

    set(CMAKE_MACOSX_RPATH OFF)
    
    add_library(your-lib SHARED)
    

提交回复
热议问题