Building with support for both OpenNI and OpenNI2 results in linking conflict (Bug #4158)
Description
Building WITH_OPENNI and WITH_OPENNI2 results in a linking conflict between two object files that define the same function:
CMakeFiles/opencv_videoio.dir/src/cap_openni2.cpp.o: In function `cvCreateCameraCapture_OpenNI(int)':
cap_openni2.cpp:(.text._Z28cvCreateCameraCapture_OpenNIi+0x0): multiple definition of `cvCreateCameraCapture_OpenNI(int)'
CMakeFiles/opencv_videoio.dir/src/cap_openni.cpp.o:cap_openni.cpp:(.text._Z28cvCreateCameraCapture_OpenNIi+0x0): first defined here
CMakeFiles/opencv_videoio.dir/src/cap_openni2.cpp.o: In function `cvCreateFileCapture_OpenNI(char const*)':
cap_openni2.cpp:(.text._Z26cvCreateFileCapture_OpenNIPKc+0x0): multiple definition of `cvCreateFileCapture_OpenNI(char const*)'
CMakeFiles/opencv_videoio.dir/src/cap_openni.cpp.o:cap_openni.cpp:(.text._Z26cvCreateFileCapture_OpenNIPKc+0x0): first defined here
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:225: recipe for target 'lib/libopencv_videoio.so.3.0.0' failed
make[2]: *** [lib/libopencv_videoio.so.3.0.0] Error 1
Associated revisions
Merge pull request #4158 from alalek:fix-bigdata-copyto
History
Updated by Maksim Shabunin almost 10 years ago
- Status changed from New to Open
- Assignee set to Maksim Shabunin
- Category set to build/install
- Target version changed from 3.0 to 3.1
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4918