Sign in to follow this  

problem with "Beginning OpenGL Game Programming" book

This topic is 3731 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

the first example in the book (using glut) worked fine, however the example in chapter 2(not using glut) dosen't work, and gives me ton of errors, im using Microsoft Visual C++ 2005 using the "Empty Poject" as template. I don't think i dont think the errors are related to the code, but i'll post it anyway.(copy+paste from the cd) code: CGfxOpenGL.h
[source langg = "cpp"]#ifndef __GL_COMPONENT
#define __GL_COMPONENT

#define PI 3.14159
#define TWO_PI PI*2.0
#define HALF_PI PI/2.0

class CGfxOpenGL
{
private:
	int m_windowWidth;
	int m_windowHeight;

	float m_angle;

public:
	CGfxOpenGL();
	virtual ~CGfxOpenGL();

	bool Init();
	bool Shutdown();

	void SetupProjection(int width, int height);

	void Prepare(float dt);
	void Render();
};

#endif 

code: CGfxOpenGL.cpp
[source langg = "cpp"]#ifndef __GL_COMPONENT
#define __GL_COMPONENT

#define PI 3.14159
#define TWO_PI PI*2.0
#define HALF_PI PI/2.0

class CGfxOpenGL
{
private:
	int m_windowWidth;
	int m_windowHeight;

	float m_angle;

public:
	CGfxOpenGL();
	virtual ~CGfxOpenGL();

	bool Init();
	bool Shutdown();

	void SetupProjection(int width, int height);

	void Prepare(float dt);
	void Render();
};

#endif 

code: winmain.cpp
[source langg = "cpp"] #define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN

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

#include "CGfxOpenGL.h"

bool exiting = false;
long windowWidth = 800;
long windowHeight = 600;
long windowBits = 32;
bool fullscreen = false;
HDC hDC;

CGfxOpenGL *g_glRender = NULL;

void SetupPixelFormat(HDC hDC)
{
    int pixelFormat;

    PIXELFORMATDESCRIPTOR pfd =
    {   
        sizeof(PIXELFORMATDESCRIPTOR),  // size
            1,                          // version
            PFD_SUPPORT_OPENGL |        // OpenGL window
            PFD_DRAW_TO_WINDOW |        // render to window
            PFD_DOUBLEBUFFER,           // support double-buffering
            PFD_TYPE_RGBA,              // color type
            32,                         // prefered color depth
            0, 0, 0, 0, 0, 0,           // color bits (ignored)
            0,                          // no alpha buffer
            0,                          // alpha bits (ignored)
            0,                          // no accumulation buffer
            0, 0, 0, 0,                 // accum bits (ignored)
            16,                         // depth buffer
            0,                          // no stencil buffer
            0,                          // no auxiliary buffers
            PFD_MAIN_PLANE,             // main layer
            0,                          // reserved
            0, 0, 0,                    // no layer, visible, damage masks
    };

    pixelFormat = ChoosePixelFormat(hDC, &pfd);
    SetPixelFormat(hDC, pixelFormat, &pfd);
}

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);
        SetupPixelFormat(hDC);
        //SetupPalette();
        hRC = wglCreateContext(hDC);
        wglMakeCurrent(hDC, hRC);
        break;

    case WM_DESTROY:            // window destroy
    case WM_QUIT:
    case WM_CLOSE:                  // windows is closing

        // deselect rendering context and delete it
        wglMakeCurrent(hDC, NULL);
        wglDeleteContext(hRC);

        // send WM_QUIT to message queue
        PostQuitMessage(0);
        break;

    case WM_SIZE:
        height = HIWORD(lParam);        // retrieve width and height
        width = LOWORD(lParam);

        g_glRender->SetupProjection(width, height);

        break;

    case WM_ACTIVATEAPP:        // activate app
        break;

    case WM_PAINT:              // paint
        PAINTSTRUCT ps;
        BeginPaint(hWnd, &ps);
        EndPaint(hWnd, &ps);
        break;

    case WM_LBUTTONDOWN:        // left mouse button
        break;

    case WM_RBUTTONDOWN:        // right mouse button
        break;

    case WM_MOUSEMOVE:          // mouse movement
        break;

    case WM_LBUTTONUP:          // left button release
        break;

    case WM_RBUTTONUP:          // right button release
        break;

    case WM_KEYUP:
        break;

    case WM_KEYDOWN:
        int fwKeys;
        LPARAM keyData;
        fwKeys = (int)wParam;    // virtual-key code 
        keyData = lParam;          // key data 

        switch(fwKeys)
        {
        case VK_ESCAPE:
            PostQuitMessage(0);
            break;
        default:
            break;
        }

        break;

    default:
        break;
    }
    return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

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

    windowRect.left=(long)0;                        // Set Left Value To 0
    windowRect.right=(long)windowWidth; // Set Right Value To Requested Width
    windowRect.top=(long)0;                         // Set Top Value To 0
    windowRect.bottom=(long)windowHeight;   // Set Bottom Value To Requested Height

    // fill out the window class structure
    windowClass.cbSize          = sizeof(WNDCLASSEX);
    windowClass.style           = CS_HREDRAW | CS_VREDRAW;
    windowClass.lpfnWndProc     = MainWindowProc;
    windowClass.cbClsExtra      = 0;
    windowClass.cbWndExtra      = 0;
    windowClass.hInstance       = hInstance;
    windowClass.hIcon           = LoadIcon(NULL, IDI_APPLICATION);  // default icon
    windowClass.hCursor         = LoadCursor(NULL, IDC_ARROW);      // default arrow
    windowClass.hbrBackground   = NULL;                             // don't need background
    windowClass.lpszMenuName    = NULL;                             // no menu
    windowClass.lpszClassName   = "GLClass";
    windowClass.hIconSm         = LoadIcon(NULL, IDI_WINLOGO);      // windows logo small icon

    // register the windows class
    if (!RegisterClassEx(&windowClass))
        return 0;

    if (fullscreen)                             // fullscreen?
    {
        DEVMODE dmScreenSettings;                   // device mode
        memset(&dmScreenSettings,0,sizeof(dmScreenSettings));
        dmScreenSettings.dmSize = sizeof(dmScreenSettings); 
        dmScreenSettings.dmPelsWidth = windowWidth;         // screen width
        dmScreenSettings.dmPelsHeight = windowHeight;           // screen height
        dmScreenSettings.dmBitsPerPel = windowBits;             // bits per pixel
        dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;

        // 
        if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
        {
            // setting display mode failed, switch to windowed
            MessageBox(NULL, "Display mode failed", NULL, MB_OK);
            fullscreen = FALSE; 
        }
    }

    if (fullscreen)                             // Are We Still In Fullscreen Mode?
    {
        dwExStyle=WS_EX_APPWINDOW;                  // Window Extended Style
        dwStyle=WS_POPUP;                       // Windows Style
        ShowCursor(FALSE);                      // Hide Mouse Pointer
    }
    else
    {
        dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;   // Window Extended Style
        dwStyle=WS_OVERLAPPEDWINDOW;                    // Windows Style
    }

    AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle);     // Adjust Window To True Requested Size

    // class registered, so now create our window
    hwnd = CreateWindowEx(NULL,                                 // extended style
        "GLClass",                          // class name
        "BOGLGP - Chapter 2 - OpenGL Application",      // app name
        dwStyle | WS_CLIPCHILDREN |
        WS_CLIPSIBLINGS,
        0, 0,                               // x,y coordinate
        windowRect.right - windowRect.left,
        windowRect.bottom - windowRect.top, // width, height
        NULL,                               // handle to parent
        NULL,                               // handle to menu
        hInstance,                          // application instance
        NULL);                              // no extra params

    hDC = GetDC(hwnd);

    // check if window creation failed (hwnd would equal NULL)
    if (!hwnd)
        return 0;

    ShowWindow(hwnd, SW_SHOW);          // display the window
    UpdateWindow(hwnd);                 // update the window

    g_glRender->Init();

    while (!exiting)
    {
        g_glRender->Prepare(0.0f);
        g_glRender->Render();
        SwapBuffers(hDC);

        while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
        {
            if (!GetMessage (&msg, NULL, 0, 0))
            {
                exiting = true;
                break;
            }

            TranslateMessage (&msg);
            DispatchMessage (&msg);
        }
    }

    delete g_glRender;

    if (fullscreen)
    {
        ChangeDisplaySettings(NULL,0);          // If So Switch Back To The Desktop
        ShowCursor(TRUE);                       // Show Mouse Pointer
    }

    return (int)msg.wParam;
}

included in "Additional dependencies": opengl32.lib glu32.lib errors:
Quote:
Error 1 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1152 Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1152 Error 3 error C2146: syntax error : missing ';' before identifier 'glAccum' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1152 Error 4 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1152 Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1152 Error 6 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 8 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 9 error C2146: syntax error : missing ';' before identifier 'glAlphaFunc' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 10 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 11 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1153 Error 13 error C2146: syntax error : missing ';' before identifier 'GLboolean' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1154 Error 14 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1154 Error 15 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1154 Error 16 error C2146: syntax error : missing ';' before identifier 'glAreTexturesResident' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1154 Error 17 error C2371: 'APIENTRY' : redefinition; different basic types C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1154 Error 18 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1154 Error 19 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 20 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 21 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 22 error C2146: syntax error : missing ';' before identifier 'glArrayElement' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 23 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 24 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 25 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1155 Error 26 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 27 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 28 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 29 error C2146: syntax error : missing ';' before identifier 'glBegin' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 30 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 31 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 32 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1156 Error 33 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 34 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 35 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 36 error C2146: syntax error : missing ';' before identifier 'glBindTexture' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 37 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 38 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 39 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1157 Error 40 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 41 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 42 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 43 error C2146: syntax error : missing ';' before identifier 'glBitmap' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 44 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 45 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 46 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1158 Error 47 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 48 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 49 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 50 error C2146: syntax error : missing ';' before identifier 'glBlendFunc' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 51 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 52 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 53 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1159 Error 54 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 55 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 56 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 57 error C2146: syntax error : missing ';' before identifier 'glCallList' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 58 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 59 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 60 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1160 Error 61 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 62 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 63 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 64 error C2146: syntax error : missing ';' before identifier 'glCallLists' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 65 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 66 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 67 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1161 Error 68 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 69 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 70 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 71 error C2146: syntax error : missing ';' before identifier 'glClear' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 72 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 73 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 74 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1162 Error 75 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 76 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 77 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 78 error C2146: syntax error : missing ';' before identifier 'glClearAccum' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 79 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 80 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 81 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1163 Error 82 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 83 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 84 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 85 error C2146: syntax error : missing ';' before identifier 'glClearColor' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 86 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 87 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 88 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1164 Error 89 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 90 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 91 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 92 error C2146: syntax error : missing ';' before identifier 'glClearDepth' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 93 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 94 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 95 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1165 Error 96 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 97 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 98 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 99 error C2146: syntax error : missing ';' before identifier 'glClearIndex' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 100 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 101 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 102 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1166 Error 103 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 104 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 105 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 106 error C2146: syntax error : missing ';' before identifier 'glClearStencil' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 107 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 108 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 109 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1167 Error 110 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 111 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 112 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 113 error C2146: syntax error : missing ';' before identifier 'glClipPlane' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 114 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 115 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 116 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1168 Error 117 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 118 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 119 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 120 error C2146: syntax error : missing ';' before identifier 'glColor3b' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 121 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 122 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 123 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1169 Error 124 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 125 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 126 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 127 error C2146: syntax error : missing ';' before identifier 'glColor3bv' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 128 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 129 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 130 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1170 Error 131 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 132 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 133 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 134 error C2146: syntax error : missing ';' before identifier 'glColor3d' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 135 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 136 error C2086: 'int APIENTRY' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 137 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1171 Error 138 error C2144: syntax error : 'void' should be preceded by ';' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1172 Error 139 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1172 Error 140 error C2086: 'int WINGDIAPI' : redefinition C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1172 Error 141 error C2146: syntax error : missing ';' before identifier 'glColor3dv' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1172 Error 142 error C2182: 'APIENTRY' : illegal use of type 'void' C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1172 Error 143 fatal error C1003: error count exceeds 100; stopping compilation C:\Programmer\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\gl.h 1172
thanks in advice!

Share this post


Link to post
Share on other sites
Hmmm. It seems theres no such file as gl/gl.h or gl/glu.h, i only have a GLUT.h in that folder. Does anyone know where i can download the gl.h and glu.h headers, ive sought through opengl.org with no luck finding a download page.

It seems it had something to do with the

#ifdef _WINDOWS
#include <windows.h>
#endif

in CGFxOpenGL.cpp, removing the ifdef and endif statement(still having #include <windows.h>) seems to solve it. Why the heck' is this so? :S

[Edited by - MadsGustaf on September 29, 2007 9:35:22 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by MadsGustaf
Hmmm. It seems theres no such file as gl/gl.h or gl/glu.h, i only have a GLUT.h in that folder. Does anyone know where i can download the gl.h and glu.h headers, ive sought through opengl.org with no luck finding a download page.

It used to come with Visual Studio, if not mistaken
The OpenGL dlls already include with the O.S (Windows 95 OSR2, Windows 98, and Windows NT).

Share this post


Link to post
Share on other sites

This topic is 3731 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this