Question

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);
}
Was it helpful?

Solution

This can be solved by adding

-lglut -lGL -lGLU

to compile command in Build->Set Build Commands menu

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top