Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implicit declaration of function 'glReadPixels' is invalid in C99 compiling on ios 8

I have a Problem when I try to compiling my iOS project with iOS 8.

The errors messages are:

 Implicit declaration of function 'glReadPixels' is invalid in C99 compiling
 Conflicting types for 'glReadPixels'
 Declaration of 'glReadPixels' must be imported from module 'OpenGLES.ES3.gl' before it is required
like image 692
Josué H. Avatar asked Sep 24 '14 12:09

Josué H.


People also ask

What is implicit declaration of function in C90?

In C90, if a function is called without an explicit declaration, the compiler is going to complain about the implicit declaration. Here is a small code that will give us an Implicit declaration of function error. Now the above code will give you an error of Implicit declaration.

What happens if a function is called without an explicit declaration?

In C90, if a function is called without an explicit declaration, the compiler is going to complain about the implicit declaration. Here is a small code that will give us an Implicit declaration of function error.

Do every function have to be explicitly declared in C?

Every function must be explicitly declared before it can be called. In C90, if a function is called without an explicit declaration, the compiler is going to complain about the implicit declaration.

Can I skip the declaration of a function in C99?

In the case of C99, you can skip the declaration but it will give us a small warning and it can be ignored but the definition of the function is important. This gives us the output:


2 Answers

Recently I have faced the same issue.

The easiest way to resolve this problem is by adding @import OpenGLES; line in each file where you have got this message.

like image 97
tikhop Avatar answered Oct 12 '22 23:10

tikhop


For iOS 8 is necessary Import

  #import <OpenGLES/ES3/glext.h>

This link is the solution Click Here...

like image 1
Josué H. Avatar answered Oct 13 '22 00:10

Josué H.