|
-
May 7th, 2002, 08:46 PM
#1
Thread Starter
Lively Member
OpenGL Problem
Where do i install the opengl sdk(its self extracting). I tried a few diff. places and still cant make any opengl programs. Anyone else have a problem with missing dll's ?
-
May 7th, 2002, 09:28 PM
#2
Move the DLLs into either your Windows\System32 directory, or into your program's directory.
Z.
-
May 8th, 2002, 01:08 PM
#3
Monday Morning Lunatic
Re: OpenGL Problem
Originally posted by slx47
Where do i install the opengl sdk(its self extracting). I tried a few diff. places and still cant make any opengl programs. Anyone else have a problem with missing dll's ?
OpenGL SDK? The Silicon Graphics one?
That's been unsupported by them for a while now. Why can't you just use the normal documentation?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 03:34 PM
#4
Thread Starter
Lively Member
I should say im using windows xp. Does anyone know if gl has problems running on xp ?
-
May 8th, 2002, 03:41 PM
#5
Monday Morning Lunatic
OpenGL runs pretty much perfectly on everything as long as there are drivers for it.
http://www.parksie.net/gl2.zip
Does this run at an acceptable speed?
What graphics card do you have?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 03:45 PM
#6
Thread Starter
Lively Member
k
i know i have all the dll's,.h,.lib files in the right spot. Now when i compile some on my programs it compiles but it has problems linking. The linker has problems with the functions under main()
Code:
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>
#include <math.h>
// Define a constant for the value of PI
#define GL_PI 3.1415f
// Rotation amounts
static GLfloat xRot = 0.0f;
static GLfloat yRot = 0.0f;
// Called to draw scene
void RenderScene(void)
{
GLfloat x,y,z,angle; // Storeage for coordinates and angles
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
// Save matrix state and do the rotation
glPushMatrix();
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
// Call only once for all remaining points
glBegin(GL_LINES);
z = 0.0f;
for(angle = 0.0f; angle <= GL_PI*3.0f; angle += 0.5f)
{
// Top half of the circle
x = 50.0f*sin(angle);
y = 50.0f*cos(angle);
glVertex3f(x, y, z);
// Bottom half of the circle
x = 50.0f*sin(angle+3.1415f);
y = 50.0f*cos(angle+3.1415f);
glVertex3f(x, y, z);
}
// Done drawing points
glEnd();
// Restore transformations
glPopMatrix();
// Flush drawing commands
glutSwapBuffers();
}
// This function does any needed initialization on the rendering
// context.
void SetupRC()
{
// Black background
glClearColor(0.0f, 0.0f, 0.0f, 1.0f );
// Set drawing color to green
glColor3f(0.0f, 1.0f, 0.0f);
}
void SpecialKeys(int key, int x, int y)
{
if(key == GLUT_KEY_UP)
xRot-= 5.0f;
if(key == GLUT_KEY_DOWN)
xRot += 5.0f;
if(key == GLUT_KEY_LEFT)
yRot -= 5.0f;
if(key == GLUT_KEY_RIGHT)
yRot += 5.0f;
if(key > 356.0f)
xRot = 0.0f;
if(key < -1.0f)
xRot = 355.0f;
if(key > 356.0f)
yRot = 0.0f;
if(key < -1.0f)
yRot = 355.0f;
// Refresh the Window
glutPostRedisplay();
}
void ChangeSize(int w, int h)
{
GLfloat nRange = 100.0f;
// Prevent a divide by zero
if(h == 0)
h = 1;
// Set Viewport to window dimensions
glViewport(0, 0, w, h);
// Reset coordinate system
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Establish clipping volume (left, right, bottom, top, near, far)
if (w <= h)
glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange, nRange);
else
glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange, nRange);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutCreateWindow("Lines Example");
glutReshapeFunc(ChangeSize);
glutSpecialFunc(SpecialKeys);
glutDisplayFunc(RenderScene);
SetupRC();
glutMainLoop();
return 0;
}
-
May 8th, 2002, 03:51 PM
#7
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:07 PM
#8
Thread Starter
Lively Member
I checked and i have all the right files in the right places. The links says this:
c:\documents and settings\ralph\my documents\untitled1.o(.text+0xf):untitled1.cpp: undefined reference to `glClear@4'
c:\documents and settings\ralph\my documents\untitled1.o(.text+0x17):untitled1.cpp: undefined reference to `glFlush@0'
c:\documents and settings\ralph\my documents\untitled1.o(.text+0x39):untitled1.cpp: undefined reference to `glClearColor@16'
c:\documents and settings\ralph\my documents\untitled1.o(.text+0x5d):untitled1.cpp: undefined reference to `glutInitDisplayMode@4'
c:\documents and settings\ralph\my documents\untitled1.o(.text+0x6d):untitled1.cpp: undefined reference to `glutCreateWindow@4'
c:\documents and settings\ralph\my documents\untitled1.o(.text+0x7d):untitled1.cpp: undefined reference to `glutDisplayFunc@4'
c:\documents and settings\ralph\my documents\untitled1.o(.text+0x8a):untitled1.cpp: undefined reference to `glutMainLoop@0'
-
May 8th, 2002, 04:09 PM
#9
Monday Morning Lunatic
You need to make sure you're linking with opengl32.lib and glut32.lib.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:13 PM
#10
Thread Starter
Lively Member
I think the lib files should work i dont why it isnt working !!!
-
May 8th, 2002, 04:15 PM
#11
Monday Morning Lunatic
What compiler?
Under MSVC, go to Project Settings->Linker, and add them to the list.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:17 PM
#12
Thread Starter
Lively Member
i use: dec 4 c++ for a compiler. I also tried code warrior and it doesnt work for that either.
-
May 8th, 2002, 04:22 PM
#13
Monday Morning Lunatic
Oh.
Are the .lib files in the directory the linker will look in? Also the glut32.lib file was made with the latest Microsoft linker so that might affect it.
You're probably best off downloading GLUT 3.7 and compiling it yourself to get a .lib out of it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:27 PM
#14
Thread Starter
Lively Member
-
May 8th, 2002, 04:29 PM
#15
Monday Morning Lunatic
You'd need to check the compiler/linker documentation for more details, I really can't help much further (happy VC user here)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:30 PM
#16
Thread Starter
Lively Member
ive just tried vc and that didnt work either. Im not sure if its windows xp or not but no compiler will work with it.
-
May 8th, 2002, 04:33 PM
#17
Monday Morning Lunatic
Do you have the Platform SDK? You probably need the linker tools from that.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:35 PM
#18
Thread Starter
Lively Member
no i dont have the platform sdk.
-
May 8th, 2002, 04:37 PM
#19
Monday Morning Lunatic
Download it then 
It's extremely useful; I think you need the build tools as well (gaaaaawd why can't people just get along and write files that work with something else!!)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:38 PM
#20
Thread Starter
Lively Member
do you know where i can get it from ?
-
May 8th, 2002, 04:40 PM
#21
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 8th, 2002, 04:49 PM
#22
Thread Starter
Lively Member
the site
there is no option to download it, you can only order a cd for 8.00 is there another way to download ?
-
May 8th, 2002, 04:51 PM
#23
Monday Morning Lunatic
http://www.microsoft.com/msdownload/...sdk/sdkupdate/
If you want to keep with Dev-C++ your best bet is to generate the libraries using that...I don't have a copy though.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|