IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.6k stars 4.83k forks source link

PCL + OpenCV Library error #4199

Closed ltstein closed 5 years ago

ltstein commented 5 years ago
Required Info
Camera Model D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version Win 10 x64

| Platform | PC | | SDK Version | { legacy / 2.<?>.<?> } | | Language | {C++/opencv/pcl/unity } | | Segment | {Robot/VR/AR/others } |

Issue Description

Following https://github.com/freemanlo/librealsense/tree/issue2977/wrappers/opencv and https://github.com/freemanlo/librealsense/tree/issue2977/wrappers/pcl I have built opencv 3.4.6 and installed PCL 1.8.1. Then, I used cmake to generate a VS2017 solution(x64). In this solution, I can run the rs-color (C), rs-dnn(OpenCV) and rs-pcl(PCL) examples successfully. However, when I try to run rs-pcl-color example, I run into errors LNK2038 mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in rs-pcl-color.obj rs-pcl-color XXXXXXXXXXX\librealsense\build\wrappers\pcl\pcl-color\opencv_calib3d346d.lib(rho.obj).

From what I can tell, this might be because OpenCV was built with static libraries (Per issue 2977) but I believe I will need them to be static for creating dlls for use with Unity so I am wondering if there is another solution.

ltstein commented 5 years ago

Upon further testing and building OpenCV with shared libs, the issue has resolved.