我正在尝试使用 C++ 版本 14 和 cmake 版本 3.14 从 MACOS 上的 ALGLIB 网页编译和运行 spline1d_d 示例。(代码在这里:http ://www.alglib.net/translator/man/manual.cpp.html#example_spline1d_d_cubic )
编译器抛出以下错误消息。可以请人帮忙吗?
正在按预期找到来自 ALGLIB 的包含:包括 include
编译器错误消息:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/peter/CLionProjects/test_scripts/cmake-build-debug --target test_scripts -- -j 4
Scanning dependencies of target test_scripts
[ 50%] Building CXX object CMakeFiles/test_scripts.dir/main.cpp.o
[100%] Linking CXX executable test_scripts
Undefined symbols for architecture x86_64:
"alglib::spline1dgriddiffcubic(alglib::real_1d_array const&, alglib::real_1d_array const&, alglib::real_1d_array&, alglib::xparams)", referenced from:
_main in main.cpp.o
"alglib::spline1dgriddiff2cubic(alglib::real_1d_array const&, alglib::real_1d_array const&, alglib::real_1d_array&, alglib::real_1d_array&, alglib::xparams)", referenced from:
_main in main.cpp.o
"alglib::xdefault", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [test_scripts] Error 1
make[2]: *** [CMakeFiles/test_scripts.dir/all] Error 2
make[1]: *** [CMakeFiles/test_scripts.dir/rule] Error 2
make: *** [test_scripts] Error 2