#cmake 配置
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
endif()
include_directories(${CMAKE_SOURCE_DIR}/lib)
find_library(XXX_LIB
xxxx${_lib_suffix}.a
${CMAKE_SOURCE_DIR}/lib)
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} ${XXX_LIB})
// 头文件需要添加 extern "C" 标识,否则会出现“未定义的引用”的错误
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef __cplusplus
}
#endif