DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Opengl

  1. #1
    Join Date
    Nov 2005
    Posts
    68

    Opengl

    i got this program and it makes a blank screen of green. the only problem is is that is doesnt work i keep getting this wierd error. this is the code-
    #include <GL/glut.h>
    #include <GL/gl.h>
    using namespace std;

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

    void SetupRC(void)
    {
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    }
    int main(void)
    {
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutCreateWindow("simple");
    glutDisplayFunc(RenderScene);

    SetupRC();
    glutMainLoop();


    return 0;
    }
    and these are the errors i get-
    1 C:\Dev-Cpp\OpenGL.cpp In file included from C:\Dev-Cpp\OpenGL.cpp
    43 C:\Dev-Cpp\include\GL\glut.h redeclaration of C++ built-in type `short'
    can some one please help

  2. #2
    Join Date
    Dec 2003
    Posts
    3,366
    short is a c++ keyword, and the compiler thinks that you have redefined it in opengl.cpp somewhere. Probably, you have opengl.lib & .dll and should include the lib in the project not the .cpp -- but this is a guess (I don't remember ever having an opengl.cpp that was used in a project, it exists only to compile the library and probably has a *very* special makefile -- remember, this stuff was created on unix and is old enough to be a little strange).

Similar Threads

  1. OpenGL tutorials
    By Beaverbutt8 in forum C++
    Replies: 1
    Last Post: 11-14-2005, 08:35 AM
  2. C# / OpenGl
    By OpenGl Programmer in forum .NET
    Replies: 2
    Last Post: 11-13-2002, 01:20 PM
  3. Directx8 or OpenGL in C#
    By Bob Jones in forum .NET
    Replies: 0
    Last Post: 07-31-2001, 10:54 PM
  4. C# and DirectX API or OpenGL...
    By Morgan in forum .NET
    Replies: 3
    Last Post: 11-24-2000, 06:33 PM
  5. DirectX or OpenGL for .NET?
    By Frank van Leeuwen in forum .NET
    Replies: 0
    Last Post: 10-21-2000, 09:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links