Can anyone help me with compiling some GLUT code with windows XP...what do I need? and where do I get it?
Cheers.
Can anyone help me with compiling some GLUT code with windows XP...what do I need? and where do I get it?
Cheers.
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.
I am currently using Borland c/c++ compiler 5.5
Originally posted by nexusone:
What compiler are you using?
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
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.
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?
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(&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>
Try
#include <windows.h>
before gl.h
[This message has been edited by bakery2k (edited 10-15-2002).]
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
you definitely have to include <windows.h> before using the gl**.h files