undefined reference with shared library using cmake

前端 未结 1 1887
攒了一身酷
攒了一身酷 2021-01-20 03:54

I have looked a lot of placed to find this answer, but I have not been able to find anything that pertains to my situation. It seems so easy, which is why this is so frustr

相关标签:
1条回答
  • 2021-01-20 04:35

    Don't assume that the directory containing CMakeLists.txt is the current directory at runtime. Instead, use ${CMAKE_CURRENT_SOURCE_DIR} whenever you want a path relative to the CMakeLists.txt. For example:

    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/hdr)
    
    0 讨论(0)
提交回复
热议问题