This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compile OpenGL ES 2.0
#1
I'm using Tinker OS 2.0.7 and trying to compile OpenGL ES 2.0 programs.

Here is a simple example program (I understand this is not a valid runnable program):

Code:
#include <GLES2/gl2.h>

int main(int argc, char ** argv)
{
               glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
               
               return 0;
}


When I try t compile it is unable to find glClear:
Code:
linaro@tinkerboard:/share$ gcc -c test.cpp
test.cpp: In function ‘int main(int, char**)’:
test.cpp:5:53: error: ‘glClear’ was not declared in this scope
 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

GLES2 header are installed and being included by gcc:
Code:
linaro@tinkerboard:/share$ grep glClear /usr/include/GLES2/gl2.h
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);

Is there something I'm missing in order to compile OpenGL ES programs on Tinker OS?

Thanks
Reply
#2
Couldn't be a path problem ?
Reply
#3
If I remove or rename /usr/include/GLES2/gl2.h it fails to compile because the header couldn't be found, so it looks to be correctly finding that file.

Code:
linaro@tinkerboard:/share$ sudo mv /usr/include/GLES2/gl2.h /usr/include/GLES2/gl2.h.renamed
linaro@tinkerboard:/share$ gcc -c test.cpp
test.cpp:1:23: fatal error: GLES2/gl2.h: No such file or directory

                      ^
compilation terminated.

Also I tried adding #pragma message "Got here" to gl2.h to verify that the area where the functions were declared was not getting excluded due to a #ifdef and it looks to be including the function declarations.

I messed one "Got Here" checks with #pragma message.

All the function signatures are under a #ifdef GL_GLEXT_PROTOTYPES. It compiles after defining this.
Reply
#4
Hi all

can you try to update mali library as following steps?

$ cd ~ && git clone https://github.com/rockchip-linux/libmali.git
$ cd ~/libmali
$ cmake .
$ make
$ sudo make install
Reply
#5
Updating the Mali library resolves the issue. (No need to add the additional define)

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)