0

I try to compile c program :

#include<GL/glut.h>
#include<GL/glew.h>
#include<GL/gl.h>
#include<GL/glu.h>
void main(int argc, char **argv) {
        glutInit(&argc, argv);
        glewInit();
        if (glewIsSupported("GL_VERSION_2_0"))
            printf("Ready for OpenGL 2.0\n");
        else {
            printf("OpenGL 2.0 not supported\n");
            exit(1);
        }

        setShaders();

        glutMainLoop();
    }

using:

gcc -lGLEW -lGLU -lGL - lglut c.c

I got an error :

 gcc: error: lglut: No such file or directory

So I check :

 locate glut.h
 /usr/include/GL/freeglut.h
 /usr/include/GL/glut.h
 /usr/share/doc/freeglut3-dev/freeglut.html

also :

locate glut.so
/usr/lib/x86_64-linux-gnu/libglut.so
/usr/lib/x86_64-linux-gnu/libglut.so.3
/usr/lib/x86_64-linux-gnu/libglut.so.3.9.0

What should I do to make it compile ?

3

after your code you have this command, using:

gcc -lGLEW -lGLU -lGL - lglut c.c

perhaps it should be using:

gcc -lGLEW -lGLU -lGL -lglut c.c

there may be an unintended space between the - and lglut

  • #include <stdio.h> – Adam Jan 12 '14 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.