Android NDK: Undefined reference error

Shaji Thorn Blue picture Shaji Thorn Blue · Jan 31, 2014 · Viewed 10.8k times · Source

When I am compiling irrlicht project it showing me so many undefined reference error. I guess its looking for egl.h which comes with android ndk package.

Here is error logs :

[armeabi] SharedLibrary  : libirrlichttest.so
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleInput(android_app*, AInputEvent*):jni/Android/CIrrDeviceAndroid.cpp:274: error: undefined reference to 'AInputEvent_getType'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleInput(android_app*, AInputEvent*):jni/Android/CIrrDeviceAndroid.cpp:277: error: undefined reference to 'AMotionEvent_getPointerCount'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleInput(android_app*, AInputEvent*):jni/Android/CIrrDeviceAndroid.cpp:278: error: undefined reference to 'AMotionEvent_getAction'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleInput(android_app*, AInputEvent*):jni/Android/CIrrDeviceAndroid.cpp:313: error: undefined reference to 'AMotionEvent_getX'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleInput(android_app*, AInputEvent*):jni/Android/CIrrDeviceAndroid.cpp:314: error: undefined reference to 'AMotionEvent_getY'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::closeDevice():jni/Android/CIrrDeviceAndroid.cpp:171: error: undefined reference to 'ANativeActivity_finish'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::run():jni/Android/CIrrDeviceAndroid.cpp:110: error: undefined reference to 'ALooper_pollAll'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::CIrrDeviceAndroid(irr::SIrrlichtCreationParameters const&):jni/Android/CIrrDeviceAndroid.cpp:55: error: undefined reference to 'ASensorManager_getInstance'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::CIrrDeviceAndroid(irr::SIrrlichtCreationParameters const&):jni/Android/CIrrDeviceAndroid.cpp:56: error: undefined reference to 'ASensorManager_createEventQueue'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::CIrrDeviceAndroid(irr::SIrrlichtCreationParameters const&):jni/Android/CIrrDeviceAndroid.cpp:69: error: undefined reference to 'ALooper_pollAll'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::CIrrDeviceAndroid(irr::SIrrlichtCreationParameters const&):jni/Android/CIrrDeviceAndroid.cpp:55: error: undefined reference to 'ASensorManager_getInstance'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::CIrrDeviceAndroid(irr::SIrrlichtCreationParameters const&):jni/Android/CIrrDeviceAndroid.cpp:56: error: undefined reference to 'ASensorManager_createEventQueue'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::CIrrDeviceAndroid(irr::SIrrlichtCreationParameters const&):jni/Android/CIrrDeviceAndroid.cpp:69: error: undefined reference to 'ALooper_pollAll'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleAndroidCommand(android_app*, int):jni/Android/CIrrDeviceAndroid.cpp:215: error: undefined reference to 'ANativeWindow_getWidth'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CIrrDeviceAndroid.o): in function irr::CIrrDeviceAndroid::handleAndroidCommand(android_app*, int):jni/Android/CIrrDeviceAndroid.cpp:216: error: undefined reference to 'ANativeWindow_getHeight'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function .LTHUNK10:jni/Android/CAndroidAssetReader.cpp:57: error: undefined reference to 'AAsset_getLength'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function .LTHUNK11:jni/Android/CAndroidAssetReader.cpp:62: error: undefined reference to 'AAsset_getLength'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function .LTHUNK11:jni/Android/CAndroidAssetReader.cpp:62: error: undefined reference to 'AAsset_getRemainingLength'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function .LTHUNK9:jni/Android/CAndroidAssetReader.cpp:50: error: undefined reference to 'AAsset_seek'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function .LTHUNK8:jni/Android/CAndroidAssetReader.cpp:45: error: undefined reference to 'AAsset_read'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function .LTHUNK5:jni/Android/CAndroidAssetReader.cpp:40: error: undefined reference to 'AAsset_close'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function irr::io::CAndroidAssetReader::~CAndroidAssetReader():jni/Android/CAndroidAssetReader.cpp:40: error: undefined reference to 'AAsset_close'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function irr::io::CAndroidAssetReader::CAndroidAssetReader(irr::core::string<char, irr::core::irrAllocator<char> > const&):jni/Android/CAndroidAssetReader.cpp:32: error: undefined reference to 'AAssetManager_open'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetReader.o): in function irr::io::CAndroidAssetReader::CAndroidAssetReader(irr::core::string<char, irr::core::irrAllocator<char> > const&):jni/Android/CAndroidAssetReader.cpp:32: error: undefined reference to 'AAssetManager_open'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetFileArchive.o): in function irr::io::CAndroidAssetFileArchive::addDirectory(irr::core::string<char, irr::core::irrAllocator<char> > const&):jni/Android/CAndroidAssetFileArchive.cpp:87: error: undefined reference to 'AAssetManager_openDir'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CAndroidAssetFileArchive.o): in function irr::io::CAndroidAssetFileArchive::addDirectory(irr::core::string<char, irr::core::irrAllocator<char> > const&):jni/Android/CAndroidAssetFileArchive.cpp:92: error: undefined reference to 'AAssetDir_getNextFileName'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::swapBuffers():jni/CEGLManager.cpp:348: error: undefined reference to 'eglSwapBuffers'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::destroyContext():jni/CEGLManager.cpp:323: error: undefined reference to 'eglMakeCurrent'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::destroyContext():jni/CEGLManager.cpp:324: error: undefined reference to 'eglDestroyContext'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::destroySurface():jni/CEGLManager.cpp:271: error: undefined reference to 'eglMakeCurrent'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::destroySurface():jni/CEGLManager.cpp:273: error: undefined reference to 'eglDestroySurface'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::terminate():jni/CEGLManager.cpp:85: error: undefined reference to 'eglMakeCurrent'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::terminate():jni/CEGLManager.cpp:87: error: undefined reference to 'eglTerminate'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:157: error: undefined reference to 'eglChooseConfig'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:240: error: undefined reference to 'eglGetConfigAttrib'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:242: error: undefined reference to 'ANativeWindow_setBuffersGeometry'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:246: error: undefined reference to 'eglCreateWindowSurface'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:249: error: undefined reference to 'eglCreateWindowSurface'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:256: error: undefined reference to 'eglBindAPI'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateSurface():jni/CEGLManager.cpp:260: error: undefined reference to 'eglSwapInterval'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::testEGLError():jni/CEGLManager.cpp:354: error: undefined reference to 'eglGetError'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::activateContext(irr::video::SExposedVideoData const&):jni/CEGLManager.cpp:331: error: undefined reference to 'eglMakeCurrent'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::generateContext():jni/CEGLManager.cpp:307: error: undefined reference to 'eglCreateContext'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::initialize(irr::SIrrlichtCreationParameters const&, irr::video::SExposedVideoData const&):jni/CEGLManager.cpp:51: error: undefined reference to 'eglGetDisplay'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(CEGLManager.o): in function irr::video::CEGLManager::initialize(irr::SIrrlichtCreationParameters const&, irr::video::SExposedVideoData const&):jni/CEGLManager.cpp:63: error: undefined reference to 'eglInitialize'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(COGLES2Driver.o): in function irr::video::COGLES2Driver::testEGLError():jni/COGLES2Driver.cpp:1633: error: undefined reference to 'eglGetError'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(COGLESExtensionHandler.o): in function irr::video::COGLES1ExtensionHandler::initExtensions(irr::video::COGLES1Driver*, bool):jni/COGLESExtensionHandler.cpp:246: error: undefined reference to 'eglGetProcAddress'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(COGLESExtensionHandler.o): in function irr::video::COGLES1ExtensionHandler::initExtensions(irr::video::COGLES1Driver*, bool):jni/COGLESExtensionHandler.cpp:247: error: undefined reference to 'eglGetProcAddress'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(COGLESExtensionHandler.o): in function irr::video::COGLES1ExtensionHandler::initExtensions(irr::video::COGLES1Driver*, bool):jni/COGLESExtensionHandler.cpp:248: error: undefined reference to 'eglGetProcAddress'
D:/Work/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libirrlicht.a(COGLESExtensionHandler.o): in function irr::video::COGLES1ExtensionHandler::initExtensions(irr::video::COGLES1Driver*, bool):jni/COGLESExtensionHandler.cpp:249: error: undefined reference to 'eglGetProcAddress'
collect2: ld returned 1 exit status
make.exe: *** [obj/local/armeabi/libirrlichttest.so] Error 1

**** Build Finished ****

And here is my android.mk(Removing some of cpp files just to take screenshot )

enter image description here

And here is my application.mk

APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-10
APP_MODULE := irrlicht 

What am I doing wrong ?

Answer

Alex Cohn picture Alex Cohn · Jan 31, 2014

You don't need to explicitly add NDK include directory to your CFLAGS. If the project fails to compile without it, your configuration is wrong.

Your Android.mk misses

LOCAL_LDLIBS := -llog -landroid -lEGL 

and probably some more ndk libs