Ask Your Question
0

gpu.hpp producing error during compile

asked 2013-07-31 12:47:28 -0600

alexar gravatar image

updated 2013-07-31 12:50:06 -0600

Hello everyone, I am attempting to recreate the code found here for marker-less AR. During compile time I run into the following errors:

1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(574): warning C4002: too many actual parameters for macro 'min'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(574): error C2226: syntax error : unexpected type 'cv::gpu::GpuMat'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(574): error C2226: syntax error : unexpected type 'cv::gpu::GpuMat'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(574): error C2059: syntax error : ')'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(577): warning C4002: too many actual parameters for macro 'min'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(577): error C2226: syntax error : unexpected type 'cv::gpu::GpuMat'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(577): error C2062: type 'double' unexpected
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(577): error C2059: syntax error : ')'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(580): warning C4002: too many actual parameters for macro 'max'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(580): error C2226: syntax error : unexpected type 'cv::gpu::GpuMat'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(580): error C2226: syntax error : unexpected type 'cv::gpu::GpuMat'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(580): error C2059: syntax error : ')'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(583): warning C4002: too many actual parameters for macro 'max'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(583): error C2226: syntax error : unexpected type 'cv::gpu::GpuMat'
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(583): error C2062: type 'double' unexpected
1>c:\opencv\build\include\opencv2\gpu\gpu.hpp(583): error C2059: syntax error : ')'

Does anyone know what might be the cause of this? I only call the 'max' function once in the code but that is from the std library, so I am unsure where it is getting the GpuMat input from. Thanks in advance!

edit retag flag offensive close merge delete

Comments

1

Are you compiling master code or branch 2.4? Because there are changes going on and probably master isn't that stable for the moment.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-31 12:51:55 -0600 )edit

Hey Steven, thanks for the reply. I am using OpenCV 2.4.6 compiled w/ CUDA and OpenGL

alexar gravatar imagealexar ( 2013-07-31 12:59:00 -0600 )edit

I was talking about openCV. Weird that it doesn't work... Can you put your piece of code where it fails?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-31 15:10:32 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-08-01 00:59:28 -0600

Vladislav Vinogradov gravatar image

It seems like min/max is defined as macros. As I remember windows.h defines such macros. Add this lines before gpu.hpp:

#undef min
#undef max
#include <opencv2/gpu/gpu.hpp>
edit flag offensive delete link more

Comments

Thanks this worked for me.

alexar gravatar imagealexar ( 2013-08-09 19:27:16 -0600 )edit

Question Tools

Stats

Asked: 2013-07-31 12:47:28 -0600

Seen: 2,085 times

Last updated: Aug 01 '13