manuzhang
manuzhang

Reputation: 3025

fail to load openGL library in NDK

I'v been trying to load openGL library in NDK-r7 on Android 2.3.3 (API Level 10) but failed. In the c source file (shape.c) I include glut library

#include <GL/glut.h>
...

My Android.mk file is as the following

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := shape
LOCAL_C_INCLUDES := /usr/include
LOCAL_SRC_FILES := shape.c
LOCAL_LDLIBS := -L/usr/lib -lglut -lGLU -lGL
include $(BUILD_SHARED_LIBRARY)

And the error information

Compile thumb  : shape <= shape.c
SharedLibrary  : libshape.so
/usr/local/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-  
x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:  
skipping incompatible /usr/lib/libglut.so when searching for -lglut
/usr/local/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-  
x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: 
skipping incompatible /usr/lib/libglut.a when searching for -lglut
/usr/local/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-
x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:   
cannot find -lglut
collect2: ld returned 1 exit status

Upvotes: 1

Views: 740

Answers (1)

datenwolf
datenwolf

Reputation: 162347

GLUT is not OpenGL, it's a third party library meant for simple OpenGL demos and tests. If you want to use GLUT you need to install it explicitly, as it does not come with OpenGL!

Upvotes: 2

Related Questions