quick solution

Started by
1 comment, last by Fruny 18 years, 6 months ago
I think the proper links have been made to the needed files. I can compile the examples are run them just fine. I again tried copying the example from chapter 2 word for word and file for file, and I get this error as well. ....Perhaps my gl.h include file is old? Actually it can't be, because the examples compile fine. I am using the WinMain from the book, "Beginning OpenGL Programming" and I will add it at the end here as well. To be specific to only difference is the class name that I use instead of what the book uses. I have killed too many hours comparing and trying to figure this out, I know what the errors mean but not why they are happening. Feels like I have just started programming, but I have been going it for years. I'm using ms visual c++ 6.0 -------------------------------------------------------------------------- NaturalResponse.cpp c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing ';' before type 'void' c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found Error executing cl.exe. NaturalResponse.obj - 3 error(s), 0 warning(s) /* WIN_specular_fog */ #define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC /* For compatibility with OpenGL v1.0 */ #define GL_LOGIC_OP GL_INDEX_LOGIC_OP #define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT /*************************************************************/ //Error happens here. /*************************************************************/ 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); WINGDIAPI void APIENTRY glArrayElement (GLint i); WINGDIAPI void APIENTRY glBegin (GLenum mode); WINGDIAPI void APIENTRY glBindTexture (GLenum target, GLuint texture); WINGDIAPI void APIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); WINGDIAPI void APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); WINGDIAPI void APIENTRY glCallList (GLuint list); WINGDIAPI void APIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); WINGDIAPI void APIENTRY glClear (GLbitfield mask); --------------------------------------------------------------------------------- #define WIN32_LEAN_AND_MEAN #define WIN32_EXTRA_LEAN #include <windows.h> #include <gl/gl.h> #include <gl/glu.h> #include "NaturalResponse.h" bool exiting = false; long windowWidth = 800; long windowHeight = 600; long windowBits = 32; bool fullscreen = true; HDC hDC; NaturalResponse *g_glRender = NULL; void SetupPixelFormat(HDC hDC) { int pixelFormat; PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), // size 1, // version . . . . . } LRESULT CALLBACK MainWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static HDC hDC; static HGLRC hRC; int height, width; // dispatch messages switch (uMsg) { case WM_CREATE: // window creation hDC = GetDC(hWnd); . . . . } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { WNDCLASSEX windowClass; // window class HWND hwnd; // window handle MSG msg; // message DWORD dwExstyle; // Window Extended style DWORD dwstyle; // Window style RECT windowRect; g_glRender = new NaturalResponse; . . . . }
Advertisement
youre not including any of the includes for GDI i imagine...it doesnt know what WINGDIAPI is...maybe the example had libs linked into the project you didnt see and hence cant copy...
We have youth, how about a fountain of smart.e4 e5 f4 d5
Crosspost.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement