I installed opencv on my machine using pacman (running Arch Linux), and I am now trying to compile a simple openCV program.
If I compile my code using the default compiler on my machine (GNU 9.2.0), everything works just fine. If I use -DCMAKE_CXX_COMPILER=/opt/cuda/bin/g++
(GNU 8.3.0), then I get a bunch of link errors:
/usr/bin/ld: /usr/lib/libopencv_dnn.so.4.1.2: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
/usr/bin/ld: /usr/lib/libopencv_gapi.so.4.1.2: undefined reference to `std::logic_error::logic_error(std::logic_error&&)@GLIBCXX_3.4.26'
/usr/bin/ld: /usr/lib/libopencv_gapi.so.4.1.2: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'
Looking at similar questions on SO, this is likely caused by conflicting versions of the standard library. However, the cuda version of g++ really isn't that old, so I am a bit confused. Is there something I am missing?