Ask Your Question

granteous's profile - activity

2019-01-31 06:46:18 -0600 received badge  Popular Question (source)
2012-12-17 14:34:38 -0600 asked a question opencv_core won't build with opengl support, gl.h error

OpenCV 2.4.3 CMAKE 2.8.6 VC10 SP1

I can build OpenCV module libs without using OpenGL support enabled in CMAKE but when I try and enable OpenGL support the modules fail because opencv_core cannot be built. The error is a generic error and relates to arrangement of header files, e.g. with including "include <gl.h> before include <windows.h> or I may be wrong. Am I missing something in CMAKE?

In general, the build errors are of the type:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error C2144: syntax error : 'void' should be preceded by ';'

Am I missing a preproccessor?

Here is the complete build error when I try and build opencv_core by itself:

btw this forum is bad a**.

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------ 1>Build started 12/17/2012 2:28:46 PM. 1>InitializeBuildStatus: 1> Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>FinalizeBuildStatus: 1> Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild". 1> Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.lastbuildstate". 1> 1>Build succeeded. 1> 1>Time Elapsed 00:00:00.12 2>------ Build started: Project: opencv_core, Configuration: Debug Win32 ------ 2>Build started 12/17/2012 2:28:46 PM. 2>InitializeBuildStatus: 2> Touching "opencv_core.dir\Debug\opencv_core.unsuccessfulbuild". 2>CustomBuild: 2> All outputs are up-to-date. 2>ClCompile: 2> All outputs are up-to-date. 2> opengl_interop.cpp 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error C2144: syntax error : 'void' should be preceded by ';' 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error C2146: syntax error : missing ';' before identifier 'glAccum' 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error C2182: 'APIENTRY' : illegal use of type 'void' 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error C2144: syntax error : 'void' should be preceded by ';' 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error C2086: 'int WINGDIAPI' : redefinition 2> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI' 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error C2146: syntax error : missing ';' before identifier 'glAlphaFunc' 2>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GL/gl.h(1153): error C2182: 'APIENTRY' : illegal use of type 'void' 2>C ... (more)