I’m trying to build VTK in my Linux machine, but I got below linking error. How could I fix it?
ld: CMakeFiles/vtkProbeOpenGLVersion.dir/vtkProbeOpenGLVersion.cxx.o: undefined reference to symbo ‘_ZStlsISt11char_traintsIcEERSt13basic_ostreamIcT_ES5_PKc@@GLIBCXX_3.4 ’
The glibc version in my machine is 2.12. Is the version too old to support VTK 9.1?
ben.boeckel
(Ben Boeckel (Kitware))
January 6, 2022, 3:24am
2
The glibc
version doesn’t matter at all. GLIBCXX_
is the prefix for libstdc++
and GCC 3.4 is definitely too old to get even this far…so you have that.
After fixing the typo (traints
), it demangles to:
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
which would be an odd symbol to be missing. What is the link line for this error?
GLibc 2.12 is from 2010: Glibc Timeline - glibc wiki . That’s 12 years. Upgrading is strongly recommended.
I’d love to upgrade, but I have to stay with 2.12.
Maybe you could try VTK 8 or older.
ben.boeckel
(Ben Boeckel (Kitware))
January 22, 2022, 4:10pm
7
It would seem to me that the problem is that you have gcc
linking a C++ program. If you run that command manually with g++
instead, does it work? If so, figuring out why gcc
is used to link a C++ program is the thing to investigate.