I am trying to develop a C ++ library for an iOS application. This library loads the GLES and OpenAL functions. The idea is to create a C ++ library and use the same code in iOS and Android (as as a built-in compilation). I am only with the implementation of iOS, and I made a sample application with a library, and I have this block inside the library:
#ifdef _IPHONE_4_0
#warning "Including iPhone SDK 4.0 working here" // compiling warning is actived
#include <OpenGLES / ES2 / gl.h>
#include <OpenGLES / ES2 / glext.h>
#include <OpenAL / al.h>
#include <OpenAL / alc.h>
...
#elif __ANDROID_API_ // Android
#warning "Including Android working here" // Compiling warning is not actived
...
#endif
So, the problem is with the sentence "#ifdef _IPHONE_4_0". If I use it, Xcode cannot find the include files, but if I comment on all the if clauses (part of android too), Xcode can find all of them.
#warning sentences show that the compiler reads part of the iphone (with comments and no lines) at compile time. Should the definition be used in a different way?
Thanks in advance!
source
share