An error occurs when building the GEVServer tutorial in C++ with CMake

After running CMake on the GEVServer tutorial on the Raspberry Pi 4 with a 64bit ARM OS, the following error comes up when running the make command.

[100%] Linking CXX executable QmlGevServer
/usr/bin/ld: /opt/cvb/lib/libCVGevServer.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'
/usr/bin/ld: /opt/cvb/lib/libCVGevServer.so: undefined reference to `pow@GLIBC_2.29'
/usr/bin/ld: /opt/cvb/lib/libCVGevServer.so: undefined reference to `std::__cxx11::basic_ostringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_ostringstream()@GLIBCXX_3.4.26'
/usr/bin/ld: /opt/cvb/lib/libCVCore3D.so: undefined reference to `exp@GLIBC_2.29'
/usr/bin/ld: /opt/cvb/lib/libCVGevServer.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
/usr/bin/ld: /opt/cvb/lib/libCVGevServer.so: undefined reference to `log@GLIBC_2.29'
/usr/bin/ld: /opt/cvb/lib/libCVCDriver.so: undefined reference to `std::__cxx11::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_stringstream()@GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/QmlGevServer.dir/build.make:187: QmlGevServer] Error 1
make[1]: *** [CMakeFiles/Makefile2:77: CMakeFiles/QmlGevServer.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Defining the following macro before including any standard library headers should fix your problem: #define _GLIBCXX_USE_CXX11_ABI 0

@usernv I implemented the “define” statement in the “backend.hpp” and still get the same error.

What compiler are you using?

I use the gcc (Debian 8.3.0-6) 8.3.0.

which GCC version? Could you try to use an older GCC?

~ $ gcc --version
gcc (Debian 8.3.0-6) 8.3.0

Which version should I install?

You can try
GCC 9 for Ubuntu 20.04 (and corresponding CVB) or
GCC 7 for Ubuntu 18.04.

Okay thanks, I will try both.

With GCC 7 and the CVB installation for ARM Ubuntu 18.04 it works now.
Thanks for your help :slight_smile:

1 Like