make -j wrong
Kerwin0621 opened this issue · 1 comments
when starting make -j8 compile, here is the following outputs:
[ 2%] Linking CXX executable demo_localization
[ 5%] Linking CXX executable demo_mapping
/usr/bin/ld: /home/tmp/miniconda3/lib/libopencv_core.so.4.6.0: undefined reference to std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13' /usr/bin/ld: /home/tmp/miniconda3/lib/libopencv_highgui.so.4.6.0: undefined reference to
std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/usr/bin/ld: /home/tmp/miniconda3/lib/libopencv_core.so.4.6.0: undefined reference to std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/demo_mapping.dir/build.make:523: demo_mapping] Error 1 make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/demo_mapping.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: /home/tmp/miniconda3/lib/libopencv_core.so.4.6.0: undefined reference to
std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/usr/bin/ld: /home/tmp/miniconda3/lib/libopencv_highgui.so.4.6.0: undefined reference to std::__throw_bad_array_new_length()@GLIBCXX_3.4.29' /usr/bin/ld: /home/tmp/miniconda3/lib/libopencv_core.so.4.6.0: undefined reference to
std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/demo_localization.dir/build.make:541: demo_localization] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/demo_localization.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Not very clear which lib got wrong, looking forward your reply!
This issue is solved. The reason is the mistake opencv lib found. There might be several versions of opencv installed by different methods, but you need to set the version compiled by C++. Go CMakeLists.txt, set the opencv dir in your computer, like: set(OpenCV_DIR "/usr/lib/x86_64-linux-gnu/cmake/opencv4"), then include_directories(${OpenCV_INCLUDE_DIRS}), then solved.