Results 1 to 2 of 2

Thread: Help with A simple OpenGL and glut program

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    2

    Help with A simple OpenGL and glut program

    Hi,
    I am new to OpenGL. I am trying to run an example 'glut_helloWolrd' program in VS2005. But I am finding a lot of errors, 143 !. I found a solution for s bit liking problem to include OpenGL32.lib, I search the net but don't find one.
    I will be very thankful if some one looks into my problem & also kindly tell me the source from where, I can get lib file.

    #include <GL/gl.h>
    #include <GL/glut.h>

    void display() {
    glClear(GL_COLOR_BUFFER_BIT);
    glFlush();
    }

    int main(int argc, char **argv) {
    glutInit(&argc, argv);
    glutInitWindowSize(512,512);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutCreateWindow("The glut hello world program");
    glutDisplayFunc(display);
    glClearColor(0.0, 0.0, 0.0, 1.0);
    glutMainLoop(); // Infinite event loop
    return 0;
    }

    errors(a few of those)

    Compiling...
    glut_helloWorld.cpp
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C2144: syntax error : 'void' should be preceded by ';'
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1172) : error C2182: 'APIENTRY' : illegal use of type 'void'
    .
    .
    .
    d:\programs\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1172) : fatal error C1003: error count exceeds 100; stopping compilation
    Build log was saved at "file://c:\Documents and Settings\admin\Desktop\Augmented Reality\OpenGL_C++\VS_glut_source\glut_C++\glut_C+ +\Debug\BuildLog.htm"
    glut_C++ - 143 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    thanks a lot in advance.....

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    2

    Re: Help with A simple OpenGL and glut program

    OK,
    thanks to all people.
    I found from some source solution to add
    #include <windows.h>.
    its working mow !
    I will need your help in coming days....

Similar Threads

  1. Nothing is drawing in my simple openGL program.
    By Kevin2341 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-09-2015, 12:46 PM
  2. Simple OpenGL program not working correctly
    By repmovsd in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-23-2010, 06:37 PM
  3. Simple Glut Program and .NET 2002
    By bidaum in forum OpenGL: Windows
    Replies: 2
    Last Post: 01-31-2005, 05:49 AM
  4. why won't this super-simple glut program run right?
    By jmg in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-10-2003, 12:17 AM
  5. NVidia GLU glut GL simple program problems
    By shalperi in forum OpenGL: Linux
    Replies: 8
    Last Post: 11-22-2001, 09:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean