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

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

Open
ChinJoshi opened this issue Sep 27, 2018 · 3 comments
Open

Comments

@ChinJoshi
Copy link

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
Copy link
Author

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
Copy link
Author

I have also installed CUDA 9.2 succcesfully

@jespestana
Copy link

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).

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

2 participants