Fail to buid opencv 3.3 with opencv_contrib and Cuda 8.0

asked 2017-09-19 03:19:21 -0500

Compvis gravatar image

updated 2017-09-19 03:44:55 -0500

Hi,

I just build opencv 3.3 from source with opencv_contrib and vs2017 . When I use CMake, I get this error:

CMake Error at cmake/OpenCVUtils.cmake:945 (target_compile_definitions):

Cannot specify compile definitions for target "opencv_world" which is not built by this project.

Call Stack (most recent call first):

modules/core/CMakeLists.txt:67 (ocv_target_compile_definitions)

modules/world/CMakeLists.txt:13 (include)

modules/world/CMakeLists.txt:32 (include_one_module)

Could you please help me how to fix this error ! I tried to fix but I was not successful Thank you !

edit retag flag offensive close merge delete

Comments

1

please disable the BUILD_opencv_world module, when building with opencv_contrib, build single module libs instead.

berak gravatar imageberak ( 2017-09-19 03:21:39 -0500 )edit

Thank you, after disabling BUILD_opencv_world, I can configure but can't generate project files. I get this error:

CMake Error at F:/dev/sdk/opencv-master/opencv-master/cmake/OpenCVUtils.cmake:976 (add_library): Cannot find source file:

F:/dev/sdk/opencv-master/opencv-master/build/modules/xfeatures2d/CMakeFiles/cuda_compile.dir/src/cuda/$(Configuration)/cuda_compile_generated_surf.cu.obj

Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Call Stack (most recent call first): F:/dev/sdk/opencv-master/opencv-master/cmake/OpenCVModule.cmake:830 (ocv_add_library) F:/dev/sdk/opencv-master/opencv-master/cmake/OpenCVModule.cmake:749 (_ocv_create_module) F:/dev/sdk/opencv-master/opencv-master/cmake/OpenCVModule.cmake:974 (ocv_create_module)

Compvis gravatar imageCompvis ( 2017-09-19 03:47:24 -0500 )edit

and this error:

CMake Error: CMake can not determine linker language for target: opencv_contrib_world CMake Error in F:/dev/sdk/opencv_contrib-master_2/opencv_contrib-master/modules/contrib_world/CMakeLists.txt: Exporting the target "opencv_contrib_world" is not allowed since its linker language cannot be determined

Compvis gravatar imageCompvis ( 2017-09-19 03:49:52 -0500 )edit
1

can you try to clean up your build folder, and start all over with cmake ?

and disable opencv_contrib_world, too.

berak gravatar imageberak ( 2017-09-19 03:50:40 -0500 )edit

Your right ! It works. Thank you so much !

Compvis gravatar imageCompvis ( 2017-09-19 04:02:46 -0500 )edit