Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

You should include the flag of gles and the library.

  gcc ./*.c -o xxx `pkg-config --cflags --libs gles`
share|improve this answer
    
hi, i tried this and got : "Package gels was not found in the pkg-config search path. Perhaps you should add the directory containing `gels.pc' to the PKG_CONFIG_PATH environment variable No package 'gels' found" –  saeed hardan Jun 13 '13 at 12:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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