NDK-build GLuint 在尝试编译时不命名类型
NDK-build GLuint does not name a type when trying to compile
显然我不太确定如何在我的 SDL 应用程序中包含 Open GL
我有:
if _ANDROID_
#include <GLES2/gl2.h>
#include <GLES2/glext.h>
但是当我使用 GLUint 我得到
GLuint does not name a type
我的android.mk包括
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
我正在为 android 平台 10 (** **)
构建
APP_PLATFORM := android-10
APP_ABI := armeabi-v7a armeabi x86
所以我不太确定我做错了什么
(添加了有问题的文件的其余部分:)
#pragma once
#include <stdlib.h>
#include <iostream>
#include <random>
#include <cassert>
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"
#include "mat4.h"
#include "transformations.h"
#if defined(_MSC_VER)
#include <windows.h>
#include <glew.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <SDL_opengl.h>
#include <stdio.h>
#include <string>
#endif
#if __APPLE__
#include <SDL2/SDL.h>
#include <SDL2_image/SDL_image.h>
#include <SDL2_ttf/SDL_ttf.h>
#include <SDL2_mixer/SDL_mixer.h>
#endif
#if __ANDROID__
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <SDL_mixer.h>
#endif
// vec2 *screen;
/*const*/ // int sw;
/*const*/ // int sh;
#if __IPHONEOS__ || __ANDROID__
#define MOBILE 1
#endif
#if __MACOSX__ || __WINDOWS__ || __LINUX__
#define PC 1
#endif
#if __IPHONEOS__
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayOES(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysOES(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysOES(n, ids);
}
#elif TARGET_OS_MAC
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayAPPLE(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysAPPLE(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysAPPLE(n, ids);
}
#elif __ANDROID__
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayOES(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysOES(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysOES(n, ids);
}
#endif // ANDROID
inline string get_path(string filename) {
char *base = SDL_GetBasePath();
string path(base + filename);
SDL_free(base);
//cout << "getting path " << path << endl;
return path;
}
using namespace std;
我用
解决了
APP_STL := c++_static
而不是
#APP_STL := gnustl_static
显然我不太确定如何在我的 SDL 应用程序中包含 Open GL
我有:
if _ANDROID_
#include <GLES2/gl2.h>
#include <GLES2/glext.h>
但是当我使用 GLUint 我得到
GLuint does not name a type
我的android.mk包括
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
我正在为 android 平台 10 (** **)
构建APP_PLATFORM := android-10
APP_ABI := armeabi-v7a armeabi x86
所以我不太确定我做错了什么
(添加了有问题的文件的其余部分:)
#pragma once
#include <stdlib.h>
#include <iostream>
#include <random>
#include <cassert>
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"
#include "mat4.h"
#include "transformations.h"
#if defined(_MSC_VER)
#include <windows.h>
#include <glew.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <SDL_opengl.h>
#include <stdio.h>
#include <string>
#endif
#if __APPLE__
#include <SDL2/SDL.h>
#include <SDL2_image/SDL_image.h>
#include <SDL2_ttf/SDL_ttf.h>
#include <SDL2_mixer/SDL_mixer.h>
#endif
#if __ANDROID__
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <SDL_mixer.h>
#endif
// vec2 *screen;
/*const*/ // int sw;
/*const*/ // int sh;
#if __IPHONEOS__ || __ANDROID__
#define MOBILE 1
#endif
#if __MACOSX__ || __WINDOWS__ || __LINUX__
#define PC 1
#endif
#if __IPHONEOS__
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayOES(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysOES(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysOES(n, ids);
}
#elif TARGET_OS_MAC
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayAPPLE(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysAPPLE(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysAPPLE(n, ids);
}
#elif __ANDROID__
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayOES(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysOES(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysOES(n, ids);
}
#endif // ANDROID
inline string get_path(string filename) {
char *base = SDL_GetBasePath();
string path(base + filename);
SDL_free(base);
//cout << "getting path " << path << endl;
return path;
}
using namespace std;
我用
解决了APP_STL := c++_static
而不是
#APP_STL := gnustl_static