首页 > 其他分享 >cmake编译报错 undefined reference to `xxx'

cmake编译报错 undefined reference to `xxx'

时间:2023-03-26 20:14:24浏览次数:45  
标签:cmake undefined reference 编译 Module1A 报错

错误信息:F:/github/Demos/br_cmake_proj/Demos/CmakeProject2/main.cpp:11: undefined reference to `Module1A::Module1A()'

代码目录结构

相关代码片段


错误根因:模块.cmake中对SOURCES误加$符。正确写法为list(APPEND SOURCES ${CMAKE_CURRENT_LIST_DIR}/Module1A.cpp)


修改后编译ok

标签:cmake,undefined,reference,编译,Module1A,报错
From: https://www.cnblogs.com/hiloong/p/17259338.html

相关文章