且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Linux上将libc ++链接到CMake项目

更新时间:2023-11-10 18:41:34

别忘了将编译器设置为clang ++:

Don't forget to set the compiler to clang++:

set(CMAKE_CXX_COMPILER "clang++")

此外,清除cmake生成的文件(删除文件夹CMakeFilesCMakeCache.txt).

Also, purge the cmake generated files (delete the folder CMakeFiles and CMakeCache.txt).

根据您的系统,它可能也有助于设置

Depending on your system, it might also help to set

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")