3

I want to program somthing using opengl es , i search software center for anything related
and i found libgles1-mesa-dev , then i wrote a simple main program and included :

#include <GLES/gl.h>  
#include <GLES/glext.h>  

and it compiles , but if i try to use an opengl es function it says undefined reference . (meaning the include without using functions compiles , but after writing a function it gives that error)

i compiled using simple

gcc ./*.c -o xxx  

how can i use this library to program opengl es 1.x ?
or opengl es in general ?

2 Answers2

3

i did this and it worked :

 1) sudo apt-get install libgles1-mesa libgles1-mesa-dev
 2) sudo apt-get install freeglut3 freeglut3-dev
 3) gcc ./*.c -o "XXX" -L/usr/lib/x86_64-linux-gnu/ -lGLESv1_CM -lglut  

those steps on ubuntu 13.04 64bit , because the "-L/usr/lib/x86_64-linux-gnu/"
changes depending on your distro.

1

You should include the flag of gles and the library.

  gcc ./*.c -o xxx `pkg-config --cflags --libs gles`
Eric Carvalho
  • 55,453
syler
  • 56
  • 1