Wingdiapi void apientry glaccum declaration syntax error

wingdiapi void apientry glaccum declaration syntax error

Error: declaration syntax error gl.h line 1151 WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);. Error: declaration syntax error. 8\VC\PlatformSDK\include\GL/gl.h(1152): error C2144: syntax error: 'void' should be preceded by ';' see declaration of 'WINGDIAPI'. The error is: 1> Touching error C2144: syntax error: void should be preceded by ; see declaration of WINGDIAPI.

Wingdiapi void apientry glaccum declaration syntax error - the same

gl.h file error

The header file is only
#include <gl\gl.h>//OpenGL Header

#include <gl\glu.h>//GLu32 Header

I get the following error

1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1152): error C2144: syntax error: "void" should be preceded by ";"

1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1152): error C4430: missing type specifier-int assumed. Note: C++ does not support the default int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1152): error C2146: syntax error: missing ";" (in the identifier Before "glAccum")
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1152): error C2182: "APIENTRY": illegal use of "void" type
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1152): error C4430: missing type specifier-int assumed. Note: C++ does not support the default int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1153): error C2144: syntax error: "void" should be preceded by " ;"
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1153): error C4430: missing type specifier-int assumed. Note: C++ does not support default int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1153): error C2086: “int WINGDIAPI”: redefine
1> c:\program files (x86)/microsoft visual studio 10.0\vc\include\gl\gl.h(1152): see "WINGDIAPI" statement
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h( 1153): error C2146: syntax error: missing ";" (before the identifier "glAlphaFunc")
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1153 ): error C2182: "APIENTRY": Illegal use of "void" type
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1153): error C2086: "int APIENTRY ": Redefine
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1152): see the declaration of "APIENTRY"
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1153): error C4430: missing type specifier-int assumed. Note: C++ does not support the default int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1154): error C2146: syntax error: missing ";" (in the identifier Before "GLboolean")
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\gl.h(1154): error C4430: Missing type specifier-assume int. Note: C++ does not support default int

. . . . . .

One less header file:

#include <windows.h> //Windows Header #include <gl\gl.h> //OpenGL Header #include <gl\glu.h> //GLu32 Header

Reprinted at: https://www.cnblogs.com/Vulkan/archive/2012/05/09/7530293.html

Khronos Forums

I’m trying to run a simple openGL program, but I’m getting the following error as a result of the line

#include <gl/gl.h>

The error is:

Error E2141 c:\Borland\Bcc55\include\gl\gl.h 1153: Declaration syntax error
Error E2238 c:\Borland\Bcc55\include\gl\gl.h 1154: Multiple declaration for ‘WINGDIAPI’
Error E2344 c:\Borland\Bcc55\include\gl\gl.h 1153: Earlier declaration of ‘WINGDIAPI’

This error actually repeats for every line in gl.h until 1161 where it bails out because of too many errors. If you look in gl.h, starting at line 1153, there’s a bunch of function declarations. Here’s the first three as an example:

WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
WINGDIAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
WINGDIAPI GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);

and this goes on 'till line 1488. I ran a search throughout the whole file for anything like “#define WINGDIAPI” and any “#include” but came up short.

What could be the problem?

)

Kevin Hoang

17-03-2011, 02:47 PM

Lần sau chú ý cách trình bày code lên diễn đàn, Kevin đã chỉnh lại cho dễ nhìn. Nếu cứ quăng ra đó chắc chắn chẳng ai muốn ngó tới! Lưu ý rằng bạn cần đọc luật lệ tham gia, nếu bạn không đọc bài viết sau sẽ bị xóa bỏ mà không có bất kỳ thông báo nào.

Nếu sử dụng Visual Studio để viết code này hãy thay thế: #include<iostream.h> bằng #include<iostream>

kenzso

17-03-2011, 04:58 PM

#include<windows.h> // Phải include thư viện này vô trước
#include<gl/gl.h>
#include<gl/glut.h>

vBulletin® Version 4.2.2, Copyright © 2022 vBulletin Solutions, Inc. All rights reserved. Administer by Kevin Hoang