Ask Your Question

Building OpenCV 2.4.3 in Visual Studio 2012 and CUDA 5.0

asked 2013-01-31 05:10:55 -0600

Nicola17 gravatar image

updated 2013-01-31 05:46:33 -0600

Hi everybody. I'm trying to compile OpenCV from source in Visual Studio 2012 with CUDA 5.0.

First of all I added CUDA to Visual Studio 2012 following this guide:

Everything is ok and i can compile my CUDA project.

Then, using CMake, I've created the solution for buildig OpenCV in Visual Studio 2012 and now my problems truly begin.

During CMake configuration/generation CUDA 5.0 is correctly found nevertheless Visual Studio projects hold no information about Cuda compilation.

So I specified in Custom Buil for opencv_core project CUDA 5.0 and "CUDA C/C++" in as element type.

when I build the project I have several errors like: error C2065: 'greater_equal': undeclared identifier I:...\opencv_2_4_3\modules\core\src\gpumat.cpp error C2065: 'less_equal': undeclared identifier I:...\opencv_2_4_3\modules\core\src\gpumat.cpp

So I added

#include < functional >

and I can compile this project but I think this is only a temporary solution.

When I compile opencv_gpu come the bigger problem: For example when i compile I receive the following errors error C2061: errore di sintassi: identificatore 'ParameterType' i:...\opencv_2_4_3\modules\gpu\include\opencv2\gpu\device\functional.hpp error C2039: 'ParameterType': non è un membro di 'cv::gpu::device::TypeTraits ' i:..\opencv_2_4_3\modules\gpu\include\opencv2\gpu\device\functional.hpp

And i can't get rid of it!

Can you please give me an help? I need to compile OpenCv as soon as possibile :(

I read several other post on the topic but no one has my very problem

Thank you for the help

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-01-31 07:25:42 -0600

ubehagelig gravatar image

If you download VC2010 and CUDA 4.2 then you can get it working with the compiled libs that comes with OpenCV 2.4.3.

Simply follow this guide:

Note that this is for VC2008 (VC9) and 32-bit Windows. So change all VC9 to VC10 and if you are running 64-bit Windows you have to refer to the 64-bit folder instead of x86.

edit flag offensive delete link more


I have needs to build it with Visual Studio 2012 and CUDA 5.0 There's no other way? When will be supported?

Nicola17 gravatar imageNicola17 ( 2013-01-31 07:29:41 -0600 )edit

I am sure you can get it working by using CMAKE to create your own libs for VS2012 using CUDA 5.0 - it can just be a real pain compiling your own library files. Why do you need to use VS2012 and CUDA 5.0?

ubehagelig gravatar imageubehagelig ( 2013-01-31 08:42:40 -0600 )edit

I always build my OpenCV version from source with CMAKE... I figured out the problem... it seems that building directly from the solution generated with CMAKE is not specified the version of visual studio so nvcc send an error (only 9.0 and 10.0 supported).

If you change the solution accordingly to my original post, you'll have some code compiled with VS2010 and some other with 2012.

:/ Damn Nvidia... Come on!

Nicola17 gravatar imageNicola17 ( 2013-01-31 10:31:52 -0600 )edit

Question Tools

1 follower


Asked: 2013-01-31 05:10:55 -0600

Seen: 3,198 times

Last updated: Jan 31 '13