-1

I am trying to compile and run the spline1d_d example from ALGLIB web page on MACOS using C++ Version 14 and cmake Version 3.14. (code is here: http://www.alglib.net/translator/man/manual.cpp.html#example_spline1d_d_cubic)

The compiler throws the below error message. Can please somebody help?

Includes from ALGLIB are being found as expected: include include

The COMPILER ERROR MESSAGE:

/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
PeterT
  • 63
  • 1
  • 6

1 Answers1

0

I think your using the wrong architecture. 64 bit or 32 bit. Another error about linking in c++ is that you didn't add reference path to c++ header files in project settings

Reza Akraminejad
  • 1,412
  • 3
  • 24
  • 38