Ask Your Question
0

gpu.hpp producing error during compile

asked Jul 31 '13

alexar gravatar image

updated Jul 31 '13

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!

Preview: (hide)

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 (Jul 31 '13)edit

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

alexar gravatar imagealexar (Jul 31 '13)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 (Jul 31 '13)edit

1 answer

Sort by » oldest newest most voted
3

answered Aug 1 '13

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>
Preview: (hide)

Comments

Thanks this worked for me.

alexar gravatar imagealexar (Aug 10 '13)edit

Question Tools

Stats

Asked: Jul 31 '13

Seen: 2,089 times

Last updated: Aug 01 '13