在 ubuntu 下,clion 配置 gsl 库,报错如下:
CMakeFiles/intergration.dir/main.cpp.o:在函数‘ main ’中: /CLionProjects/intergration/main.cpp:24:对‘ gsl_set_error_handler_off ’未定义的引用 /CLionProjects/intergration/main.cpp:27:对‘ gsl_integration_workspace_alloc ’未定义的引用 /CLionProjects/intergration/main.cpp:48:对‘ gsl_integration_qags ’未定义的引用 /CLionProjects/intergration/main.cpp:49:对‘ gsl_integration_qags ’未定义的引用 /CLionProjects/intergration/main.cpp:57:对‘ gsl_integration_workspace_free ’未定义的引用 /CLionProjects/intergration/main.cpp:60:对‘ gsl_sf_gamma_inc_P ’未定义的引用
cmakelists.txt 文件如下:
cmake_minimum_required(VERSION 2.8) project(intergration)
set(CMAKE_CXX_STANDARD 11)
INCLUDE_DIRECTORIES(/usr/local/include) link_directories(/usr/local/lib)
add_library(integration main.cpp )
target_link_libraries(integration
/usr/local/include/gsl /usr/local/include
/usr/local/lib/libgsl.so /usr/local/lib/libgsl.so.23 /usr/local
/lib/libgsl.so.23.0.0
/usr/local/lib/libgslcblas.so /usr/local/lib/libgslcblas.so.0 /usr/local
/lib/libgslcblas.so.0.0.0
)
set(SOURCE_FILES main.cpp) add_executable(intergration ${SOURCE_FILES})
不知道是哪里的问题,,请教。。