Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glut exit error

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    4

    glut exit error

    Hi,
    I am using visualstudio.net to compile opengl written in c++
    In my program I have included these

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

    among a couple others
    Now when I compile I get an error complaining about exit differs

    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(256) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\glut.h(146) : see declaration of 'exit'

    I read the glut file and there is a bit of imformation about when using muliple CRT's there can be problems. But I am quite new to opengl and don't really understand this can anyone help me solve this error? please
    thanks

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    601

    Re: glut exit error

    Do you by chance declare an exit function? If so, don't - rename it, change its scope, change its prototype from the standard exit, etc. If not, give more info though I don't know what info you might give other than posting more code - where you call exit in your prog, etc. I haven't had any issues with VC7 or VC8

  3. #3
    Junior Member Newbie
    Join Date
    May 2005
    Location
    San Luis Obispo, CA
    Posts
    1

    Re: glut exit error

    I've had this problem as well...it seems that GLUT defines an exit() function of its own, and I've had problems whenever I include <gl/glut.h> before <stdlib.h>. The solution that works for me is to make sure that I include <stdlib.h> before Iinclude <gl.glut.h>. Hope that helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •