Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing android_main ? #13

Open
rbarara opened this issue Jun 27, 2017 · 1 comment
Open

Missing android_main ? #13

rbarara opened this issue Jun 27, 2017 · 1 comment

Comments

@rbarara
Copy link

rbarara commented Jun 27, 2017

Thanks for pointing to install. After setting environment variables, I get the following error (seems like :
android_native_app_glue.c:233: error: undefined reference to 'android_main' is the issue).. Am I missing a library ?

Android NDK: android-9 is unsupported. Using minimum supported version android-14.
Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersion 1 in src/main/AndroidManifest.xml. NDK binaries will not be comptible with devices older than android-14. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.
[armeabi] Prebuilt : libopencv_java3.so <= /Users/rajan/opencv/sdk//native/jni/../libs/armeabi/
[armeabi] Install : libopencv_java3.so => libs/armeabi/libopencv_java3.so
[armeabi] Compile++ thumb: visionpipeline <= crvimage.cpp
[armeabi] Compile++ thumb: visionpipeline <= timeutil.cpp
[armeabi] Compile++ thumb: visionpipeline <= normroi2.cpp
[armeabi] Compile++ thumb: visionpipeline <= facedetection.cpp
[armeabi] Compile++ thumb: visionpipeline <= visionpipeline.cpp
[armeabi] Compile++ thumb: visionpipeline <= visionpipeline_jni.cpp
[armeabi] Compile thumb : android_native_app_glue <= android_native_app_glue.c
[armeabi] StaticLibrary : libandroid_native_app_glue.a
[armeabi] SharedLibrary : libvisionpipeline.so

/Users/rajan/Library/Android/sdk/ndk-bundle/sources/android/native_app_glue/android_native_app_glue.c:233: error: undefined reference to 'android_main'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [src/main/obj/local/armeabi/libvisionpipeline.so] Error 1

:eviacam:ndkBuild FAILED

FAILURE: Build failed with an exception.

@cmauri
Copy link
Owner

cmauri commented Jun 28, 2017

Not sure why this happens it seems that compiles fine but fails at link time. Which NDK version are you using? In my case is android-ndk-r13b. Did you try to google the error?

Note that you just need to export one environment variable (OPENCV_ANDROID_SDK), and that such variable should be visible in Android Studio.

Finally, it seems you are on a Mac. It should work just fine, but I never tried to compile the project on a Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants