cmake生成動態鏈接庫過程中出現報錯解決

報錯1:

simple_case.cc:(.text+0x230): undefined reference to `dlopen'
simple_case.cc:(.text+0x244): undefined reference to `dlerror'
simple_case.cc:(.text+0x31b): undefined reference to `dlsym'
simple_case.cc:(.text+0x32f): undefined reference to `dlerror'

在cmakelist.txt文件中添加以下設置:(添加鏈接庫)

TARGET_LINK_LIBRARIES(${PROJECT_NAME} pthread dl)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章