PDA

View Full Version : opengl cant run



glstudent
03-16-2004, 02:46 AM
What's the meaning of these messages? I always get them after compilin, both in Windows n Linux. In windows i use DevC++.

...\gl\window.o(.text+0x73):window.cpp: undefined reference to `gluOrtho2D@32'
...\gl\window.o(.text+0xdb):window.cpp: undefined reference to `glutInit@8'
...\gl\window.o(.text+0xe8):window.cpp: undefined reference to `glutInitDisplayMode@4'
...\gl\window.o(.text+0xfd):window.cpp: undefined reference to `glutInitWindowSize@8'
...\gl\window.o(.text+0x10f):window.cpp: undefined reference to `glutInitWindowPosition@8'
...\gl\window.o(.text+0x11f):window.cpp: undefined reference to `glutCreateWindow@4'
...\gl\window.o(.text+0x12f):window.cpp: undefined reference to `glutDisplayFunc@4'
...\gl\window.o(.text+0x13f):window.cpp: undefined reference to `glutMouseFunc@4'
...\gl\window.o(.text+0x14c):window.cpp: undefined reference to `glutMainLoop@0'

Honk
03-16-2004, 04:09 AM
You have to add glut32.lib to your linker stage.

glstudent
03-16-2004, 03:06 PM
That's for windows, i guessed. But what about for Linux. In linux, it shows error (the same error) on every gl functions.

EraZer
03-16-2004, 04:37 PM
You are using Linux?! So you are DOOMED. And I don't mean you shall make Doom.
In the fact, no one knows how linux works. But I think, you should add this library same like you have added other libraries (you have added, right? opengl32.lib for example). Maybe -lglut32 parameter will be good.

Oh, I don't know: Windows is for multimedia, not Linux. Remember, that OS-es were created to help people with use of computer. Not for debugging.

nexusone
03-16-2004, 06:01 PM
Don't listen to EraZer he is a total morron, linux also dose multimedia.

You are not linking the glut libraries, depending on which compiler you are using the settings are diffrent.

I have examples of how to setup Dev-C++ on my website: www.angelfire.com/linux/nexusone/ (http://www.angelfire.com/linux/nexusone/)
Now one version of Dev-C++ was missing the glut library and another had the header in the wrong directory.
My website will show you where everything should be located.

On linux, where distro are you using? Most the big name ones like Redhat come with all the standard openGL librarys. Note on Redhat, you will have to download and install both the glut runtime librarys(like windows dll files) and glut developer librarys.



Originally posted by EraZer:
You are using Linux?! So you are DOOMED. And I don't mean you shall make Doom.
In the fact, no one knows how linux works. But I think, you should add this library same like you have added other libraries (you have added, right? opengl32.lib for example). Maybe -lglut32 parameter will be good.

Oh, I don't know: Windows is for multimedia, not Linux. Remember, that OS-es were created to help people with use of computer. Not for debugging.

EraZer
03-16-2004, 07:16 PM
Sorry, but who gave you right to call me morron? It is my opinion: Linux is not for multimedia. I am telling, that it can't handle multimedia devices. That system just have no futere as a home operating system for games, movies and all that stuff.

Nevermind- I think morrons are people who say: "Oh! Linux- the hackers' system" and those who call it multimedia platform.

EraZer
03-16-2004, 07:17 PM
Originally posted by EraZer:
I am telling, that it can't handle multimedia devices.

Should be I am NOT telling - sorry for mistake.

mikael_aronsson
03-16-2004, 10:42 PM
It's a free world, let people use the OS they like and you can use the one you like.

On Linux you need to add "-lglu -lgl" to the link stage.

And I guess that would be "-lglu32 -lgl32" on MinGW/DevC++

Mikael

EraZer
03-17-2004, 01:57 AM
Yes! It is free world! Free Windows Server 2003 Trial World!!!!

OK. I don't know if that parameters are good. The library that should be linked is glut, not glu or opengl. I don't know- maybe it will work; I am just not sure.

nexusone
03-17-2004, 03:49 AM
EraZer, you did not give a opinion, you made a false statment. If it had been an opinion, you would have said "in my opinion you are doom if you use linux".

I am not going to debate you on this subject, since you sound like you are Microsoft Windows fanatic and think it is the only OS in the world that can do anything.

And the fact that most movie effects and animations are done of Linux machines and high end video productions. Linux can play almost any video/audio format that is out there now. A compariable appications to any found on the Microsoft windows desktop.

This forum is for people seeking help, the person in this message did not ask's for your opinion, but help in compiling his program.

But instead of helping, you told the person that they are doomed.
Do you think that was very helpful?
I think it was the answer of a morron or maybe jurk is a better label.



Originally posted by EraZer:
Sorry, but who gave you right to call me morron? It is my opinion: Linux is not for multimedia. I am telling, that it can't handle multimedia devices. That system just have no futere as a home operating system for games, movies and all that stuff.

Nevermind- I think morrons are people who say: "Oh! Linux- the hackers' system" and those who call it multimedia platform.

Deiussum
03-17-2004, 04:12 AM
I thought Dev-C++ was Windows only?

Anyway, for linux you usually need -lGL -lGLU -lglut, and often times you also need to supply a path to the headers like so -I/usr/X11R6/include, and a path to the libraries like so -L/usr/X11R6/lib. If your libGL.so, libGLU.so, and libglut.so files are located somewhere different and are not in the library search path, you would use a different library path, as you would if the .h files are located somewhere different and not in the include file search path..

Note that Linux has case sensitive file names, so -lgl and -lGL are NOT the same thing...

Also, you may also need other libraries like -lX11, etc.

dvm
03-17-2004, 05:19 AM
The last message is correct.
Just to confirm (I'm currently using opengl + glut in a mandrake 8.2 distribution) if you've installed the latest mesa implementation (6.0 I belive) you should be able to compile a program with "gcc -o myprogram main.c -lglut". Usually when linking with glut there's no need to explicitly link with -lgl or -lglu (not that it would hurt if you did). The problem with the path for the libraries (-L/usr/X11...) I've encountered it on RedHat distribution.
If you need the site for mesa it's www.mesa3d.org (http://www.mesa3d.org)

EraZer
03-17-2004, 11:09 AM
Nexusone:
It is not a forum for discussion of that kind, but...

If you don't understand that someone can say his opinion without writing 'In my opinion', please go back to school.

I've never ever called anyone doom. I've just write that he is doomed.

That text about doom was a (specific) joke. Maybe your IQ does not allow to understand jokes without http://www.opengl.org/discussion_boards/ubb/smile.gif and http://www.opengl.org/discussion_boards/ubb/wink.gif, but I don't care. If you don't understand this, be quiet.

My opininion is that Linux is not a OS that should be used for multimedia. And I am talking about using it at home. Of course, it handles multimedia. But tell me- who really cares?

As I said- the OS-es weren't created to be still debugged or configured, but to help people. (So I even can say, Linux... aaa, nevermind- you won't understand it.)

And at the end, do NOT call me liar or morron. I know what I am talking about. Sometimes only you have to read between the rows.

EraZer
03-17-2004, 11:12 AM
And... Didn't I write something like: 'add it as other libraries'? Isn't it a helping information?

nexusone
03-17-2004, 12:00 PM
Since he had to read through all of your nagitive comments I would say no.

As for getting a joke, the only jokes I have seen is you trying to justifiy your comments bashing of linux and of the poster.



Originally posted by EraZer:
And... Didn't I write something like: 'add it as other libraries'? Isn't it a helping information?



[This message has been edited by nexusone (edited 03-17-2004).]

Deiussum
03-17-2004, 12:35 PM
Originally posted by EraZer:
Nexusone:
My opininion is that Linux is not a OS that should be used for multimedia. And I am talking about using it at home. Of course, it handles multimedia. But tell me- who really cares?


I know I shouldn't feed the troll, but...

People who use Linux care. Just because you are ignorant as to what Linux can really do, doesn't mean that everyone dismisses it as easily as you. Like nexusone, I found your post offensive, and lacking any real help.

Sure, you posted to add libraries to the command line, but you didn't even tell him the proper libraries. How much help can that really be.

What a maroon.

Honk
03-17-2004, 12:40 PM
Originally posted by EraZer:
It is not a forum for discussion of that kind...

Exactly, so why did you started it?

This is an OpenGL board and OpenGL was around long before Windows or Linux so your posts are absolutely pointless and uncalled for.

Furthermore your answers are way off-topic and not funny/ironic/whatever at all so I wish you would mind your own words:


Originally posted by EraZer:
If you don't understand this, be quiet.

EraZer
03-17-2004, 02:30 PM
I haven't started it. Nexusone has started. And OK- I will not write anything more. Just I don't like to be called morron, troll or even ignorant. I know what Linux can. But I don't like this system. Even don't think why, because you may just repeat that i am an ignorant. Above words are my opinion and THE END.

EraZer
03-17-2004, 02:32 PM
I said THE END but I forgot. WHy I have to tell anybody what libraries he should add? Doesn't he know what he have got in wonderful linux system? THE END2

glstudent
03-17-2004, 03:32 PM
Ok! I am able to run opengl in Windows...so far. but I still can manage to figure out running it in Linux (Red Hat 9). I've got all the Libraries, checked the upper/lower case, e'th seems ok. But don know why it gives all the same errors.

nexusone
03-17-2004, 04:54 PM
Did you download the GLUT library's for RedHat?

Check at RedHat.com or your install CD to see if the rpm's for it are there. Note there are two rpm files needed to write a GLUT program, one is the runtime library and the second is the developer libraries.

Note currently Redhat has issues with the GLUT library licenses, so they may no longer offer it on there site. If you can not find it, drop me an e-mail and I will see if I have a copies handy for RH9.
I just changes from RH9 to (RH)Fedora, so I also have to re-install the glut libraries for it.



Originally posted by glstudent:
Ok! I am able to run opengl in Windows...so far. but I still can manage to figure out running it in Linux (Red Hat 9). I've got all the Libraries, checked the upper/lower case, e'th seems ok. But don know why it gives all the same errors.

Latrans
03-17-2004, 06:25 PM
Originally posted by EraZer:
I said THE END but I forgot. WHy I have to tell anybody what libraries he should add? Doesn't he know what he have got in wonderful linux system? THE END2

LOL! I love seeing idiots try and defend themselves. The same thing applies to Windows. You have to know what libraries to add to the linker too. You telling someone that they need to use -lglut32 for linking glut in Linux, is like me telling you to add sockets32.lib to your linker settings when you try and use Winsock code. (In case you don't understand the correlation, there is no sockets32.lib, or at least if there is, it's not where the Winsock library code is located...)

I don't really care if you like Linux or not, but you better be preparted to take some heat for ****ting all over it, since a number of other people here do use it. Just be content with letting others use Linux, while you use your bug-ridden OS... Oh, and don't forget to download all the latest security patches. Wouldn't want anyone taking advantage of any of the many known security holes on you, now would we...

Latrans
03-17-2004, 06:27 PM
Originally posted by glstudent:
Ok! I am able to run opengl in Windows...so far. but I still can manage to figure out running it in Linux (Red Hat 9). I've got all the Libraries, checked the upper/lower case, e'th seems ok. But don know why it gives all the same errors.

Are you still getting those exact same errors, or when you use the -lglut -lGL -lGLU do you get different ones? (Like maybe missing glX functions instead of glut functions?) If they are different, try posting the exact errors that you get now.


[This message has been edited by Latrans (edited 03-17-2004).]

not_yet
03-17-2004, 07:00 PM
hi all,

still trying to get things working on fedora core 1

I've installed Mesa-6.0

when I look in the folder Mesa-6.0/lib its empty???

I get all kinds of errors when trying to compile

could someone give me a link for a linux setup for compiling opengl

thanks

dvm
03-18-2004, 12:57 AM
I think that the information in the readme files of the mesa library are enough. I'm no guru in linux (hell, I was excited that I managed to install mozilla and mesa!) but following the instruction of the mesa readme files I managed to compile the library. I haven't had much experience with red hat though. My only try there for using opengl was with the gl, glu libraries only, not glut. But since you get compile errors of the mesa library that's why you don't get any libraries produced. If you want try posting some of the errors. Maybe someone can help. After you succesfuly compiled mesa I think it's only a matter of putting the header files in the correct directory (for most I think it is /usr/include/GL) and then create some symbolic links to the libraries. Again I stress out that I had no idea of this information but read it in the readme files of mesa.

nexusone
03-18-2004, 02:15 AM
I just download fedora myself and yet to try install GLUT, but did you read my last post on the subject of RH and GLUT license.

You may need to look at freeglut, as a replacement for the standard glut library.

As for openGL on fedora, I have had no problem running openGL programs written with the SDL API on it.

Once I get the GLUT up and running will post how to set it up in fedora.

Here is a link for glut RPM's for fedora, you need both runtime and develop: http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/1/glut/

Note I have not tested these out yet.

Also when in installed fedora, did you do it as a workstation (second installation option) or Personal (I think that is what the first option is called). Anyway you may have not got all the developer library's unless you installed it as a workstation.

Also if you did not install kdevelope you may wish to go to the RPM manager and install it. It is a nice GUI compiler frontend, which has a GUI is similar the DEV-C++ interface.


Originally posted by not_yet:
hi all,

still trying to get things working on fedora core 1

I've installed Mesa-6.0

when I look in the folder Mesa-6.0/lib its empty???

I get all kinds of errors when trying to compile

could someone give me a link for a linux setup for compiling opengl

thanks

[This message has been edited by nexusone (edited 03-18-2004).]

[This message has been edited by nexusone (edited 03-18-2004).]

EraZer
03-18-2004, 02:49 AM
Originally posted by Latrans:
LOL! I love seeing idiots try and defend themselves. The same thing applies to Windows. You have to know what libraries to add to the linker too. You telling someone that they need to use -lglut32 for linking glut in Linux, is like me telling you to add sockets32.lib to your linker settings when you try and use Winsock code. (In case you don't understand the correlation, there is no sockets32.lib, or at least if there is, it's not where the Winsock library code is located...)

I don't really care if you like Linux or not, but you better be preparted to take some heat for ****ting all over it, since a number of other people here do use it. Just be content with letting others use Linux, while you use your bug-ridden OS... Oh, and don't forget to download all the latest security patches. Wouldn't want anyone taking advantage of any of the many known security holes on you, now would we...

My last word: I don't know what libraries are in Linux for glut. I know what libaries i've got in Windows. That parameter would be good for glut. And i wrote maybe -lglut32 (other tips were better? add gl and glu libraries? he needs glut- am i wrong? or maybe in linux names are diffrent).

And at the end: Number of hacked linux systems is higher than windows systems (by percent). I am not talking about UNIX- Linux only.

nexusone
03-18-2004, 04:00 AM
The linux openGL(mesa) library's and the openGL X video drivers(DRI) are already installed on Fedora, there should be no need to re-install mesa or video drivers.

Also the library files should be in the "lib" folder. I think it is usr\lib, will have to check on it.


Originally posted by not_yet:
hi all,

still trying to get things working on fedora core 1

I've installed Mesa-6.0

when I look in the folder Mesa-6.0/lib its empty???

I get all kinds of errors when trying to compile

could someone give me a link for a linux setup for compiling opengl

thanks

not_yet
03-18-2004, 07:57 PM
hello all,

thanks nexusone for the advice

have installed glut

when i try and compile mesa i get
http://www3.telus.net/blender/error1.jpg
http://www3.telus.net/blender/error2.jpg

i did install the "personal" edition of fedora, maybe i'll have to go back and install the "workstation"

in usr/lib I have

libGL.so.1
libGLU.so.1
libglut.so
libglut.so.3
ligglut.so.3.7

cheers

not_yet

nexusone
03-19-2004, 11:04 AM
The errors look like maybe your tring to compiler it as a C program when maybe you need to use the C++ compiler. Note you can compile C programs with the C++, but not the other way around.

Unless you are trying to do it for a learning experiance, mesa is already install on fadora and there is no need to recompile the mesa library.

The glut library link I posted still has a bug and will not let you compile a glut program. I tried it the other night, and got a error compiling a glut based program.

There are two ways to fix this, one download an older glut RPM like build 8 (glut3.7-8) or download the source RPM's for build 12 and rebuild both the glut-devel and glut libraries on your machine.

Deiussum
03-19-2004, 11:44 AM
I'm not sure how much help this will be, but when I was getting glut working with Slackware, I needed to recompile glut after making a minor change to the source. (One of the #defines if I remember right.) I only had to do this after I installed the nVidia drivers, though...

I don't remember what it was exactly I changed, but it was something I found in one of the posts on the Linux forum here at OpenGL.org, so a search should turn it up... I also seem to need to add a bunch of other libraries now when I try to use glut.

Oh well... I've started looking at how to use OpenGL in some of the native Xlib stuff, and with an Xt widget, so I probably won't actually even use glut for any future projects.

glstudent
03-19-2004, 03:12 PM
Hello all! The following are the errors i got from Linux:

$ make F=Window
g++ -c -o Window.o Window.cpp
gcc -Wall -I/usr/X11R6/include/ -o Window -L/usr/X11R6/lib Window.o
Window.o(.text+0x18): In function `myInit()':
: undefined reference to `glClearColor'
Window.o(.text+0x29): In function `myInit()':
: undefined reference to `glColor3f'
Window.o(.text+0x39): In function `myInit()':
: undefined reference to `glMatrixMode'
Window.o(.text+0x41): In function `myInit()':
: undefined reference to `glLoadIdentity'
Window.o(.text+0x5c): In function `myInit()':
: undefined reference to `gluOrtho2D'
Window.o(.text+0x7b): In function `myDisplay()':
: undefined reference to `glClear'
Window.o(.text+0x83): In function `myDisplay()':
: undefined reference to `glFlush'
Window.o(.text+0xa5): In function `main':
: undefined reference to `glutInit'
Window.o(.text+0xb2): In function `main':
: undefined reference to `glutInitDisplayMode'
Window.o(.text+0xc7): In function `main':
: undefined reference to `glutInitWindowSize'
Window.o(.text+0xd9): In function `main':
: undefined reference to `glutInitWindowPosition'
Window.o(.text+0xe9): In function `main':
: undefined reference to `glutCreateWindow'
Window.o(.text+0xf9): In function `main':
: undefined reference to `glutDisplayFunc'
Window.o(.text+0x109): In function `main':
: undefined reference to `glutMouseFunc'
Window.o(.text+0x116): In function `main':
: undefined reference to `glutMainLoop'
Window.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [Window] Error 1
$

Btw, please do not argue about which OS is better than the other. In my opinion, both has its pros and cons. So, let's just focus on the topic! Thanx! http://www.opengl.org/discussion_boards/ubb/smile.gif

ce110ut
03-19-2004, 04:22 PM
looks like you need to pass opengl to your linker:

g++ -o [prog name] -lGL


hope that helps.

-=[ regards ]=-

Deiussum
03-20-2004, 06:22 AM
Originally posted by ce110ut:
looks like you need to pass opengl to your linker:

g++ -o [prog name] -lGL


hope that helps.

-=[ regards ]=-

I believe this has been stated numerous times in this thread already... yet glstudent seems to constantly ignore that advice...



Hello all! The following are the errors i got from Linux:
$ make F=Window
g++ -c -o Window.o Window.cpp
gcc -Wall -I/usr/X11R6/include/ -o Window -L/usr/X11R6/lib Window.o


Since you are using a Makefile, you will likely need to add the libraries in there.

Once again, at a minimum you need to add -lGL -lGLU -lglut!

Also, seems strange to use g++ to create the .o file and then use gcc for the final link... Oh well...

glstudent
03-20-2004, 11:57 PM
From all the guides that I have, I still cannot make the compiler run opengl. In the Makefile I have included allthe libraries. Please check to see if it is ok:

INCLUDE = -I/usr/X11R6/include/
LIBDIR = -L/usr/X11R6/lib

F = simplemui
COMPILERFLAGS = -Wall

CC=gcc
CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
LIBRARIES = -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm

All: $(F)

$(F): $(F).o
$(CC) $(CFLAGS) -o $@ $(LIBDIR) $< $(LIBRARIES)

clean:
rm -f *.o

03-21-2004, 01:01 AM
So what errors are you getting now?

Please post the *entire* output from make, and confirm that you haven't changed anything from the makefile posted above.

Also, try altering your makefile to use gcc for both compilation and linking.

03-21-2004, 06:11 AM
It appears that you do not have he directory to the OpenGL libraries or header files set. The make is not finding them because it has no path.

Honk
03-21-2004, 07:50 AM
I dont mean to be rude or offending but I recommend that glstudent learns how a compiler/linkers works, what it does and what it needs, otherwise he wont understand what he is doing wrong and will stumple over this problem over and over again.

Sorry, as I said no offense intended but you have to know a tool in order to use it properly.

glstudent
03-25-2004, 01:46 AM
Originally posted by Honk:
I dont mean to be rude or offending but I recommend that glstudent learns how a compiler/linkers works, what it does and what it needs, otherwise he wont understand what he is doing wrong and will stumple over this problem over and over again.

Sorry, as I said no offense intended but you have to know a tool in order to use it properly.Yes, I agree with u. Besides, I m new to Linux. Can u point me to several links?

Honk
03-25-2004, 03:55 AM
Well the gcc documentation and man pages (enter 'man gcc' in a shell, without the quotation marks of course)should be good enough to get you started.