PDA

View Full Version : [ubuntu] Serious problem with installation of GLUT



majorka
April 21st, 2013, 10:02 AM
Hi! I have a problem with installation of glut
I've tried many different commands such as: yum install freeglut-devel, sudo apt-get install freeglut3-dev and it is not working. When I do it like here: http://freeglut.sourceforge.net/docs/install.php it does not work either.
When I use commands: sudo apt-get install freeglut3 freeglut3-dev, sudo apt-get install binutils-gold , it tells me that it is installed but when I try to compile a program it tells me that it cannot find glut.h and shows many many errors. I have no idea what I should do and what is wrong. I would be reaaaaally grateful if you could help me.

MG&TL
April 21st, 2013, 10:29 AM
I just tried this, you need to


#include <GL/glut.h>

Not:


#include <glut.h>

And obviously you need to link against GLUT.

majorka
April 21st, 2013, 10:57 AM
Actually I already have:
#include <GL/glut.h>
#include <GL/glext.h>
#include <GL/gl.h>

What do you mean by link against GLUT?

majorka
April 21st, 2013, 01:18 PM
Ok, now I have a different problem. I have errors such as : undefined reference to std:: ......
I've installed build-essential but i still have those errors. What's wrong?

MG&TL
April 21st, 2013, 02:57 PM
What do you mean by link against GLUT?

You need to specify '-lglut' on the compile command-line.

E.g.:


cc somefile.c -lglut

This tells the linker that you need to include symbols from the GLUT library.


Ok, now I have a different problem. I have errors such as : undefined reference to std:: ......
I've installed build-essential but i still have those errors. What's wrong?

Quick checks:


Have you installed a C++ compiler? (g++, clang)
Are you using it? (e.g. invoke g++ not gcc)
What compiler flags are you using?

Cheers.