Results 1 to 3 of 3

Thread: GLUT and Builder5

  1. #1
    Guest

    GLUT and Builder5

    Hello, If I want to compile this code in bilder5 I get this error message:
    [C++ Error] GLUT.H(140): E2337 Only one of a set of overloaded functions can be "C", and in glut.h it mark this row(row 140): extern _CRTIMP void __cdecl exit(int);
    Here is the code:
    #ifdef __FLAT__
    #include <windows.h>
    #endif
    #include <stdio.h>
    #include <gl\gl.h>
    #include <gl\glut.h>
    int main(int argc, char* argv[])
    {
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB );
    glutInitWindowSize(500,400);
    glutInitWindowPosition(0,0);
    glutCreateWindow("Az elso OpenGL programom");
    glClearColor(0.0,0.0,0.0,0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(0.0,0.0,1.0);
    glOrtho(-4.0,4.0,-2.0,2.0,-2.0,2.0);
    glBegin(GL_POLYGON);
    glVertex2i(-1,1);
    glVertex2i(1,1);
    glVertex2i(1,-1);
    glEnd();
    glFlush();

    getchar();

    return 0;
    }

    Anyone can help me?

  2. #2
    Guest

    Re: GLUT and Builder5

    The atexit hack does not work in C++ for the Borland compiler.

    One to disable it is to put
    #define GLUT_DISABLE_ATEXIT_HACK
    before you include glut.h

  3. #3
    Guest

    Re: GLUT and Builder5

    I tried it, howevever it doesn't work, but I tried something similar: I put #define GLUT_BUILDING_LIB before the #include <gl/glut.h> and it works!! Yuppie! So thank you.

Similar Threads

  1. glut.h not found after installing glut
    By SagoO in forum OpenGL: General
    Replies: 8
    Last Post: 11-13-2010, 08:04 PM
  2. Timers - time.h or GLUT timerfunc? GLUT or SDL..?
    By omdown in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 12-16-2009, 12:27 PM
  3. glut teapot do i need to initialize glut?
    By bansheeogl in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-01-2005, 04:21 AM
  4. Subwindows in GLUT - New section available in the GLUT tutorial
    By Antonio in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-13-2000, 10:02 AM
  5. Opengl Component of c++Builder5
    By pili in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-04-2000, 06:59 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