I would like to use the GiNaC library within a Code::Blocks C++ project, but encounter the following errors during project build:
../../ginac/lib/libginac.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
../../ginac/lib/libginac.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
collect2: error: ld returned 1 exit status
I assume the errors have something to do with incompatibility between the g++ compiler version and the stdc++ library version, but I don't know how to resolve this issue due to lack of experience.
Since I'm on a cluster and don't have root permissions, I installed the necessary prerequisite libraries GMP-6.2.1 and CLN-1.3.6 and of course GiNaC itself GiNaC-1.8.5 with the following commands into a non-default location PATH_TO_XXX, where XXX is GMP, CLN and GiNaC, respectively:
LDFLAGS="-lstdc++" ./configure --prefix=PATH_TO_XXX
make
make check
make install prefix=PATH_TO_XXX
For GMP --enable-cxx
option was added to configure. For CLN --with-gmp=PATH_TO_GMP
option was added to configure. The resulting build log gives the following entry before the errors:
g++ -L../../ginac/lib -L../../ginac/cln/lib -L../../ginac/cln/gmp/lib -L../../../../../../../../lib64 -o bin/Release/LB_COL_jetInSquareDuct_solver obj/Release/Control.o obj/Release/GridCoupling.o obj/Release/Lattice.o obj/Release/main.o obj/Release/Node.o -O2 -s -lstdc++ -lcln -lgmp -lgmpxx /lib64/libstdc++.so.6 /lib64/libgomp.so.1 ../../ginac/lib/libginac.so ../../ginac/cln/lib/libcln.so ../../ginac/cln/gmp/lib/libgmp.so ../../ginac/cln/gmp/lib/libgmpxx.so