2012-01-17 205 views
0

我得到這個,當我試圖在JNI使用OpenGL以下錯誤錯誤:GLES/gl.h:沒有這樣的文件或目錄

Compile++ thumb : itv <= native.cpp 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:1:50: warning: extra tokens at end 
of #include directive 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:3:21: error: GLES/gl.h: No such fi 
le or directory 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:4:24: error: GLES/glext.h: No such 
file or directory 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:15:1: warning: "No_Threads" redefi 
ned 
In file included from C:/workspace/InternetTV_OpenGL/jni/native.cpp:9: 
C:/workspace/InternetTV_OpenGL/jni/internetTV/MPEG2_REF_OPT/global.h:32:1: warni 
ng: this is the location of the previous definition 
In file included from C:/workspace/InternetTV_OpenGL/jni/native.cpp:1: 
C:/workspace/InternetTV_OpenGL/jni/internetTV_openGL_VideoGLSurfaceView.h:48: er 
ror: 'CALLBACK_FN_RENDER_VIDEO' has not been declared 
C:/workspace/InternetTV_OpenGL/jni/internetTV_openGL_VideoGLSurfaceView.h:51: er 
ror: 'CALLBACK_FN_RENDER_VIDEO' has not been declared 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:23: error: 'GLuint' does not name 
a type 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:24: error: 'GLuint' does not name 
a type 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:34: error: 'GLfloat' does not name 
a type 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:48: error: 'GLfloat' does not name 
a type 
C:/workspace/InternetTV_OpenGL/jni/native.cpp: In function 'void Java_internetTV 
_openGL_VideoGLSurfaceView_native_1gl_1render(JNIEnv*, _jobject*)': 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:91: error: 'GL_COLOR_BUFFER_BIT' w 
as not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:91: error: 'GL_DEPTH_BUFFER_BIT' w 
as not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:91: error: 'glClear' was not decla 
red in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:92: error: 'GL_MODELVIEW' was not 
declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:92: error: 'glMatrixMode' was not 
declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:93: error: 'glLoadIdentity' was no 
t declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:95: error: 'GL_VERTEX_ARRAY' was n 
ot declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:95: error: 'glEnableClientState' w 
as not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:96: error: 'GL_TEXTURE_COORD_ARRAY 
' was not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:97: error: 'GL_FLOAT' was not decl 
ared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:97: error: 'vertices' was not decl 
ared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:97: error: 'glVertexPointer' was n 
ot declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:98: error: 'texCoords' was not dec 
lared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:98: error: 'glTexCoordPointer' was 
not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:99: error: 'GL_TRIANGLE_STRIP' was 
not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:99: error: 'glDrawArrays' was not 
declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:100: error: 'GL_DEPTH_TEST' was no 
t declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:100: error: 'glDisable' was not de 
clared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:104: error: 'glDisableClientState' 
was not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp: In function 'void grabFrame()': 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:125: error: 'GL_TEXTURE_2D' was no 
t declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:125: error: 'GL_RGBA' was not decl 
ared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:125: error: 'GL_UNSIGNED_BYTE' was 
not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:125: error: 'glTexImage2D' was not 
declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp: In function 'void Java_kieran_ple 
asework_VideoGLSurfaceView_native_1init(JNIEnv*, _jobject*, _jstring*)': 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:132: error: 'GL_TEXTURE_2D' was no 
t declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:132: error: 'glEnable' was not dec 
lared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:133: error: 'GL_BLEND' was not dec 
lared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:133: error: 'glDisable' was not de 
clared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:136: error: 'textureId' was not de 
clared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:136: error: 'glGenTextures' was no 
t declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:137: error: 'i' was not declared i 
n this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:140: error: 'glBindTexture' was no 
t declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:143: error: 'GL_TEXTURE_MIN_FILTER 
' was not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:143: error: 'GL_LINEAR' was not de 
clared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:143: error: 'glTexParameteri' was 
not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:144: error: 'GL_TEXTURE_MAG_FILTER 
' was not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:145: error: 'GL_TEXTURE_WRAP_S' wa 
s not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:145: error: 'GL_CLAMP_TO_EDGE' was 
not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:146: error: 'GL_TEXTURE_WRAP_T' wa 
s not declared in this scope 
C:/workspace/InternetTV_OpenGL/jni/native.cpp:180: error: cannot convert 'void (
*)(unsigned char*, long unsigned int, unsigned int, unsigned int, unsigned int)' 
to 'int*' for argument '2' to 'int main_dec(char*, int*)' 
make: *** [/cygdrive/c/workspace/InternetTV_OpenGL/obj/local/armeabi/objs/itv/na 
tive.o] Error 1 

我也曾在Android.mk添加LOCAL_LDLIBS := -llog -lGLESv1_CM文件 我不知道爲什麼會出現這種類型的錯誤。 任何人都可以幫我解決這個問題嗎?

+0

編譯器不能找到GLES/gl.h。如果您只添加了一個鏈接器指令,則可能需要告訴編譯器這些標頭的位置。 – 2012-01-17 12:32:41

+0

@ReubenScratton感謝您的回覆。其實我是使用OpenGL的新手。你能告訴我我怎麼能告訴編譯器這些頭文件在哪裏? – 2012-01-17 12:41:54

+0

建議您按照此答案中的建議:http://stackoverflow.com/a/5300984/440602 – 2012-01-17 12:54:17

回答

1

回答上述問題的意見決定:

編譯器不能找到GLES/gl.h。如果您只添加了一個鏈接器指令,則可能需要告訴編譯器這些標頭的位置。

建議你遵循的建議在這個答案:stackoverflow.com/a/5300984/440602

相關問題