|
我在ubuntu上已编译好整个for android的静态库出来,cmake的命令如下:
cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=OFF -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF -DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF-DOSG_GLES1_AVAILABLE=OFF -DOSG_GLES2_AVAILABLE=ON -DANDROID_NDK=$NDK
但是在编译osgAndroidExampleGLES2,出现大量找不到定义的错。看上去是gles的头文件没有找到。
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:164: error: 'GLint' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:164: error: 'GLbitfield' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:164: error: 'GLenum' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:165: error: 'GLenum' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:165: error: 'GLenum' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:165: error: 'GLint' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:176: error: ISO C++ forbids declaration of 'TglCheckFramebufferStatus' with no type
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:176: error: expected ';' before '*' token
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:209: error: 'GLenum' has not been declared
/home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/include/osg/FrameBufferObject:219: error: 'GLenum' does not name a ty
下面是osgAndroidExampleGLES2 中的Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := osgNativeLib
### Main Install dir
OSG_ANDROID_DIR := /home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1/build
OSG_INCLUDE_DIR := /home/pengao/project/openglcode/OpenSceneGraph-3.0.1/OpenSceneGraph-3.0.1
LIBDIR := $(OSG_ANDROID_DIR)/obj/local/armeabi
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_ARM_NEON := true
LIBDIR := $(OSG_ANDROID_DIR)/obj/local/armeabi-v7a
endif
### Add all source file names to be included in lib separated by a whitespace
LOCAL_C_INCLUDES:= $(OSG_INCLUDE_DIR)/include
LOCAL_CFLAGS := -Werror -fno-short-enums
LOCAL_CPPFLAGS := -DOSG_LIBRARY_STATIC
LOCAL_LDLIBS := -llog -lGLESv2 -lz -ldl
LOCAL_SRC_FILES := osgNativeLib.cpp OsgMainApp.cpp OsgAndroidNotifyHandler.cpp
LOCAL_LDFLAGS := -L $(LIBDIR) \
还请大侠们帮帮忙指导下。
ndk用的是:r7
|
|