yunchih / ORB-SLAM2-GPU2016-final

http://yunchih.github.io/ORB-SLAM2-GPU2016-final/
Other
325 stars 150 forks source link

No suitable constructor exists to convert from "int" to "CvSlice" #15

Open ChinJoshi opened 6 years ago

ChinJoshi commented 6 years ago

When building the library, I am getting an error that is quite puzzling. The error is saying No suitable constructor exists to convert from "int" to "CvSlice". I have built opencv 3.4 with CUDA and contrib modules successfully with no errors as well as eigen 3.3 and pangolin. Any help at all would be greatly appreciated.

ChinJoshi commented 6 years ago

Here is the console output:

[ 2%] Building NVCC (Device) object CMakeFiles/ORB_SLAM2.dir/src/cuda/ORB_SLAM2_generated_Cuda.cu.o [ 5%] Building NVCC (Device) object CMakeFiles/ORB_SLAM2.dir/src/cuda/ORB_SLAM2_generated_Allocator_gpu.cu.o /usr/local/include/opencv2/core/types_c.h(1359): error: no suitable constructor exists to convert from "int" to "CvSlice"

/usr/local/include/opencv2/core/types_c.h(1359): error: expected a ")"

2 errors detected in the compilation of "/tmp/tmpxft_0000436b_00000000-6_Allocator_gpu.cpp1.ii". CMake Error at ORB_SLAM2_generated_Allocator_gpu.cu.o.cmake:262 (message): Error generating file /home/chinmaya/ORB-SLAM2-GPU2016-final/build/CMakeFiles/ORB_SLAM2.dir/src/cuda/./ORB_SLAM2_generated_Allocator_gpu.cu.o

CMakeFiles/ORB_SLAM2.dir/build.make:63: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/cuda/ORB_SLAM2_generated_Allocator_gpu.cu.o' failed make[2]: [CMakeFiles/ORB_SLAM2.dir/src/cuda/ORB_SLAM2_generated_Allocator_gpu.cu.o] Error 1 CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed make[1]: [CMakeFiles/ORB_SLAM2.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

ChinJoshi commented 6 years ago

I have also installed CUDA 9.2 succcesfully

jespestana commented 5 years ago

I am using Ubuntu 14.04 and OpenCV 3.4.3, and I had the same compilation error for a different software project (see stackoverflow.com/q/52360984/896495). My error looks like this:

/media/truecrypt1/workspaces/cpp/src/opencv/modules/core/include/opencv2/core/types_c.h(1359): error: no suitable constructor exists to convert from "int" to "CvSlice"
/media/truecrypt1/workspaces/cpp/src/opencv/modules/core/include/opencv2/core/types_c.h(1359): error: expected a ")"
2 errors detected in the compilation of "/tmp/tmpxft_00000cd4_00000000-7_cudawrapper.cpp1.ii".

I am using Ubuntu 14.04 and OpenCV 3.4.3. My solution to this problem: check in your cuda code (.cu files) which #include preprocessor directive is adding an OpenCV header. Then somehow modify your code to avoid that the said header is included into in your cuda code (.cu files).