I am trying to develop a C++ library for an iOS application. This library loads the GLES and OpenAL functions. The idea is to develop a library in C++ and use the same code in iOS and Android (both as native compilation). I am only with the iOS implementation, and I have done a sample application with the 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
因此,问题在于句子“#ifdef_Iphone_4_0” 。 如果我使用它, Xcode 找不到包含的文件, 但是如果我对所有的 if lalusule (和机器人部分) 进行评论, Xcode 可以找到所有的文件 。
#warning sentences shows that the compiler is reading the iphone part (with and without lines commented) in compilation time. Do I need to use the definition in other way?
提前感谢!