Jump to content
  • Advertisement
Sign in to follow this  
jreh

OpenGL always hopefull

This topic is 4694 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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; . . . . }

Share this post


Link to post
Share on other sites
Advertisement
It looks like WINGDIAPI isn't found you'll probably need to move:

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);



below:


#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

Share this post


Link to post
Share on other sites
I'll give it a try, but it doesn't explain why other examples structured the same way work without this error. I don't mean to sound defeated, but it is starting to feel that way.

Share this post


Link to post
Share on other sites
I dont know how the other examples look like. I just know that, on win, you have to include <windows.h> before <gl.h>. You're on windoze, so you're using a win implementation of opengl, so you need to include <windows.h>...or something :)

Share this post


Link to post
Share on other sites
1st try taking out the:

#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN


Second, open up your "NaturalResponse.h" file and check to make sure that if you included OpenGL there that Windows comes before it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!