PJLab-ADG / SensorsCalibration

OpenCalib: A Multi-sensor Calibration Toolbox for Autonomous Driving
Apache License 2.0
2.42k stars 581 forks source link

WSL-Ubuntu22.04, /usr/bin/ld: cannot find -ljsoncpp: No such file or directory #132

Open zhjr2019 opened 11 months ago

zhjr2019 commented 11 months ago

zhjr@Karon:/mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib$ mkdir build && cd build zhjr@Karon:/mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/build$ cmake .. -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenCV: /usr/local/opencv480 (found version "4.8.0") -- Configuring done -- Generating done -- Build files have been written to: /mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/build zhjr@Karon:/mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/build$ make make: Warning: File 'Makefile' has modification time 1169 s in the future make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 1169 s in the future make[2]: Warning: File 'CMakeFiles/CameraCalibration.dir/flags.make' has modification time 1168 s in the future make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Warning: File 'CMakeFiles/CameraCalibration.dir/flags.make' has modification time 1168 s in the future [ 16%] Building CXX object CMakeFiles/CameraCalibration.dir/src/AutoImagePicker.cpp.o [ 33%] Building CXX object CMakeFiles/CameraCalibration.dir/src/IntrinsicCalibration.cpp.o /mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/src/IntrinsicCalibration.cpp: In member function ‘bool IntrinsicCalibration::Calibrate(const string&, const int&, const int&, const int&)’: /mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/src/IntrinsicCalibration.cpp:65:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::cxx11::basic_string >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 65 | for (int i = 0; i < file_names.size(); i++){ | ^~~~~ /mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/src/IntrinsicCalibration.cpp: In member function ‘bool IntrinsicCalibration::undistortImages(const std::vector<std::__cxx11::basic_string >&)’: /mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/src/IntrinsicCalibration.cpp:164:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::cxx11::basic_string >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 164 | for (int i = 0; i < image_names.size(); i++){ | ^~~~~~ /mnt/c/Users/zhjr/zhjrProjects/SensorsCalibration/camera_intrinsic/intrinsic_calib/src/IntrinsicCalibration.cpp:172:1: warning: no return statement in function returning non-void [-Wreturn-type] 172 | } | ^ [ 50%] Building CXX object CMakeFiles/CameraCalibration.dir/src/run_intrinsic_calibration.cpp.o [ 66%] Linking CXX static library ../lib/libCameraCalibration.a make[2]: warning: Clock skew detected. Your build may be incomplete. [ 66%] Built target CameraCalibration make[2]: Warning: File 'CMakeFiles/run_intrinsic_calibration.dir/flags.make' has modification time 1161 s in the future make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Warning: File 'CMakeFiles/run_intrinsic_calibration.dir/flags.make' has modification time 1161 s in the future [ 83%] Building CXX object CMakeFiles/run_intrinsic_calibration.dir/src/run_intrinsic_calibration.cpp.o [100%] Linking CXX executable ../bin/run_intrinsic_calibration /usr/bin/ld: cannot find -ljsoncpp: No such file or directory collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/run_intrinsic_calibration.dir/build.make:154: ../bin/run_intrinsic_calibration] Error 1 make[1]: [CMakeFiles/Makefile2:111: CMakeFiles/run_intrinsic_calibration.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

zhjr2019 commented 11 months ago

已解决:将libjsoncpp.a修改为${JSONCPP_LIBRARIES} 修改后的CMakeLists.txt image