0

This is my first time using OpenGL. I am using Linux Mint. My editor is Geany. I have installed freeglut3 and the development package. But I can run any of code.

Whenever I try to build any of my code it is saying that undefined reference. I have searched the web and also looked at so and there saying and some are saying add these to my linker flags, "-lglut -lGL -lGLU -lGLEW". I don't know how to do that, I am very new.

I usually use Windows. But now I have to use Linux and Geany. Here is my code:

#include <GL/glut.h>
#include <GL/gl.h>

int main()
{
    glClearColor(0.0, 0.0, 0.0, 0.0);
}
halfer
  • 19,824
  • 17
  • 99
  • 186
odbhut.shei.chhele
  • 5,834
  • 16
  • 69
  • 109
  • 2
    show the compilation command used by `geany` (*Build -> Set Build Commands* menu). Notice that order of program arguments to `gcc` matters a lot. Or better yet try to compile on the command line in a terminal. – Basile Starynkevitch Mar 17 '14 at 06:19
  • 1
    thanks i have solved the problem, all you have to do is add -lglut -lGL -lGLU in build->set build commands. – odbhut.shei.chhele Mar 17 '14 at 06:26

1 Answers1

1

This can be solved by adding

-lglut -lGL -lGLU

to compile command in Build->Set Build Commands menu

frlan
  • 6,950
  • 3
  • 31
  • 72