Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error k4a-calibration undefined reference open3d & opencv #6

Open
CNCKNAM opened this issue Aug 13, 2022 · 3 comments
Open

Comments

@CNCKNAM
Copy link

CNCKNAM commented Aug 13, 2022

Step

git clone https://github.com/stytim/k4a-calibration.git
cd k4a-calibration
mkdir build && cd build
cmake ..
make

After make, it shows error that camera_extrinsics.cpp is undefined reference

CMakeFiles/calib_k4a.dir/src/camera_extrinsics.cpp.o: In function `ExtrinsicsCalibration::CalculateExtrinsics(std::vector<FrameInfo, std::allocator<FrameInfo> > const&, std::vector<AlignmentTransform, std::allocator<AlignmentTransform> >&)':
camera_extrinsics.cpp:(.text+0x2b30): undefined reference to `open3d::io::WritePointCloudToPLY(std::string const&, open3d::geometry::PointCloud const&, open3d::io::WritePointCloudOption const&)'
camera_extrinsics.cpp:(.text+0x33e3): undefined reference to `open3d::io::WritePointCloudToPLY(std::string const&, open3d::geometry::PointCloud const&, open3d::io::WritePointCloudOption const&)'
CMakeFiles/calib_k4a.dir/src/camera_extrinsics.cpp.o: In function `cv::MatConstIterator::MatConstIterator(cv::Mat const*)':
camera_extrinsics.cpp:(.text._ZN2cv16MatConstIteratorC2EPKNS_3MatE[_ZN2cv16MatConstIteratorC5EPKNS_3MatE]+0xf3): undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
CMakeFiles/calib_k4a.dir/src/camera_extrinsics.cpp.o: In function `cv::Mat_<float>::operator=(cv::Mat const&)':
camera_extrinsics.cpp:(.text._ZN2cv4Mat_IfEaSERKNS_3MatE[_ZN2cv4Mat_IfEaSERKNS_3MatE]+0x189): undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
collect2: error: ld returned 1 exit status
CMakeFiles/calib_k4a.dir/build.make:191: recipe for target 'calib_k4a' failed
make[2]: *** [calib_k4a] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/calib_k4a.dir/all' failed
make[1]: *** [CMakeFiles/calib_k4a.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

@AR-Vsx
Copy link

AR-Vsx commented Sep 14, 2022

I'm getting the same errors while trying to build under Ubunutu 18.04. I'm using the latest Version of Open3D (0.15).
@stytim Could you specify which Open3D version you used ?

@AR-Vsx
Copy link

AR-Vsx commented Sep 15, 2022

So I saw your response in the other post and downgraded Open3D to version 0.12. This solved some errors, but there are still some remaining

CMakeFiles/calib_k4a.dir/src/camera_extrinsics.cpp.o: In function `cv::MatConstIterator::MatConstIterator(cv::Mat const*)':
camera_extrinsics.cpp:(.text._ZN2cv16MatConstIteratorC2EPKNS_3MatE[_ZN2cv16MatConstIteratorC5EPKNS_3MatE]+0xf3): undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
CMakeFiles/calib_k4a.dir/src/camera_extrinsics.cpp.o: In function `cv::Mat_<float>::operator=(cv::Mat const&)':
camera_extrinsics.cpp:(.text._ZN2cv4Mat_IfEaSERKNS_3MatE[_ZN2cv4Mat_IfEaSERKNS_3MatE]+0x189): undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'

@stytim Could you specify which OpenCV version you used ?

@ChangcongWang
Copy link

This error has nothing to do with the version of Open3D, it is a problem with the version of OpenCV used.
I tried to run OpenCV4 with Open3D and got the same error, presumably because of a conflict between the two libraries.
I am using OpenCV version 3.4.16 (almost the latest) and Open3D version 0.16.1. It works successfully.

Solution

Downgrade Opencv4 to 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants