GREAT-WHU / RoadLib

A lightweight library for instance-level visual road marking extraction, parameterization, mapping, etc.
GNU General Public License v3.0
217 stars 44 forks source link

make -j wrong #6

Closed Kerwin0621 closed 4 months ago

Kerwin0621 commented 4 months ago

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 tostd::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 tostd::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!

Kerwin0621 commented 4 months ago

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.