Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: OpenGL and Windows XP

  1. #1
    Guest

    OpenGL and Windows XP

    Can anyone help me with compiling some GLUT code with windows XP...what do I need? and where do I get it?

    Cheers.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: OpenGL and Windows XP

    What compiler are you using?


    Originally posted by Nutmegger:
    Can anyone help me with compiling some GLUT code with windows XP...what do I need? and where do I get it?

    Cheers.

  3. #3
    Guest

    Re: OpenGL and Windows XP

    I am currently using Borland c/c++ compiler 5.5

    Originally posted by nexusone:
    What compiler are you using?



  4. #4
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: OpenGL and Windows XP

    Here is the files you need:

    opengl32.lib
    gl.h
    glu32.lib
    glu.h
    glut32.lib
    glut.h

    Check and see if borland came with any of these files, with the .lib library files. They must be made for borland and not Microsoft VC++.

    You can try going to the borland site or a user supported site and see if they have the openGL library for the compiler.

    They are a few borland users on here, maybe they can tell you what sites to hit.


    Originally posted by Nutmegger:
    I am currently using Borland c/c++ compiler 5.5


  5. #5
    Guest

    Re: OpenGL and Windows XP

    The Compiler came with the following files... opengl32.lib, gl.h, glu32.lib, and glu.h. It didn't come with the glut32.lib or glut.h files... I will seek these out somewhere, however there seems to be a problem with the gl.h file that I DO have. when I tried to compile a simple program that basically draws dots I got the following errors:


    C:\Borland\BCC55\Bin>bcc32 star.cpp
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    star.cpp:
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1153: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1154: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1153: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1154: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1155: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1154: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1155: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1156: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1155: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1156: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1157: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1156: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1157: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1158: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1157: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1158: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1159: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1158: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1159: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1160: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1159: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1160: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1161: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1160: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1161: Declaration syntax error
    Error E2228 C:\Borland\Bcc55\include\Gl\gl.h 1161: Too many error or warning messages
    *** 26 errors in Compile ***

    C:\Borland\BCC55\Bin>

    I don't know what's wrong as the "gl.h" file is definitely in the path specified. Any Ideas?


    Originally posted by nexusone:
    Here is the files you need:

    opengl32.lib
    gl.h
    glu32.lib
    glu.h
    glut32.lib
    glut.h

    Check and see if borland came with any of these files, with the .lib library files. They must be made for borland and not Microsoft VC++.

    You can try going to the borland site or a user supported site and see if they have the openGL library for the compiler.

    They are a few borland users on here, maybe they can tell you what sites to hit.



  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: OpenGL and Windows XP

    What is the order of your include files:

    #include<GL\gl.h>
    #include<GL\glu.h>


    Originally posted by Nutmegger:
    The Compiler came with the following files... opengl32.lib, gl.h, glu32.lib, and glu.h. It didn't come with the glut32.lib or glut.h files... I will seek these out somewhere, however there seems to be a problem with the gl.h file that I DO have. when I tried to compile a simple program that basically draws dots I got the following errors:


    C:\Borland\BCC55\Bin>bcc32 star.cpp
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    star.cpp:
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1153: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1154: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1153: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1154: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1155: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1154: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1155: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1156: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1155: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1156: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1157: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1156: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1157: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1158: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1157: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1158: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1159: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1158: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1159: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1160: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1159: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1160: Declaration syntax error
    Error E2238 C:\Borland\Bcc55\include\Gl\gl.h 1161: Multiple declaration for 'WINGDIAPI'
    Error E2344 C:\Borland\Bcc55\include\Gl\gl.h 1160: Earlier declaration of 'WINGDIAPI'
    Error E2141 C:\Borland\Bcc55\include\Gl\gl.h 1161: Declaration syntax error
    Error E2228 C:\Borland\Bcc55\include\Gl\gl.h 1161: Too many error or warning messages
    *** 26 errors in Compile ***

    C:\Borland\BCC55\Bin>

    I don't know what's wrong as the "gl.h" file is definitely in the path specified. Any Ideas?



  7. #7
    Guest

    Re: OpenGL and Windows XP

    Here is the complete code:

    Code :
    #include <Gl\gl.h>
    #include <Gl\glut.h>
    //<<<<<<<<<<<<<<<<<<<<<<< myInit >>>>>>>>>>>>>>>>>>>>
     void myInit(void)
     {
        glClearColor(1.0,1.0,1.0,0.0);       // set white background color
        glColor3f(0.0f, 0.0f, 0.0f);          // set the drawing color 
     	glPointSize(4.0);		       // a ‘dot’ is 4 by 4 pixels
    	glMatrixMode(GL_PROJECTION); 
    	glLoadIdentity();
    	gluOrtho2D(0.0, 640.0, 0.0, 480.0);
    }
    //<<<<<<<<<<<<<<<<<<<<<<<< myDisplay >>>>>>>>>>>>>>>>>
    void myDisplay(void)
    {
    	glClear(GL_COLOR_BUFFER_BIT);     // clear the screen 
    	glBegin(GL_POINTS);
    		glVertex2i(100, 50);         // draw three points
    		glVertex2i(100, 130);
    		glVertex2i(150, 130);
    	glEnd();	
    	glFlush();		                 // send all output to display 
    }
     
    //<<<<<<<<<<<<<<<<<<<<<<<< main >>>>>>>>>>>>>>>>>>>>>>
    int main(int argc, char** argv)
    {
    	glutInit(&amp;argc, argv);          // initialize the toolkit
    	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); // set display mode
    	glutInitWindowSize(640,480);     // set window size
    	glutInitWindowPosition(100, 150); // set window position on screen
    	glutCreateWindow("my first attempt"); // open the screen window
    	glutDisplayFunc(myDisplay);     // register redraw function
    	myInit();                   
    	glutMainLoop(); 		     // go into a perpetual loop
    	return 0;
    }

    Originally posted by nexusone:
    What is the order of your include files:

    #include<GL\gl.h>
    #include<GL\glu.h>



  8. #8
    Junior Member Regular Contributor
    Join Date
    Dec 2001
    Location
    London, England
    Posts
    160

    Re: OpenGL and Windows XP

    Try

    #include <windows.h>
    before gl.h

    [This message has been edited by bakery2k (edited 10-15-2002).]

  9. #9
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: OpenGL and Windows XP

    If you are using glut.h, it also has defind inside to include <gl.h> and <glu.h>.

    Just have only #include <GL\glut.h> and not gl.h or glu.h

  10. #10
    Junior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Dresden, Sachsen, Germany
    Posts
    203

    Re: OpenGL and Windows XP

    you definitely have to include <windows.h> before using the gl**.h files

Posting Permissions

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