From eb6b5eb2666475372e945af4552918f3fd993148 Mon Sep 17 00:00:00 2001 From: Cheng-Shiun Tsai Date: Mon, 19 Oct 2020 15:29:49 +0100 Subject: [PATCH] Error message when demo lib doesn't have main() --- build/android/app/src/main/cpp/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/build/android/app/src/main/cpp/main.cpp b/build/android/app/src/main/cpp/main.cpp index d02bb12..7b1d624 100644 --- a/build/android/app/src/main/cpp/main.cpp +++ b/build/android/app/src/main/cpp/main.cpp @@ -217,10 +217,17 @@ void android_main(struct android_app* state) dlerror(); /* Clear any existing error */ int (*main)(int, char**) = (int (*)(int, char**))dlsym(handle, "main"); + LOGV("lib=%s handle=%p main=%p", libpath.c_str(), handle, main ); if(main) { status = main(0, nullptr); } + else + { + LOGE("lib %s doesn't have main()", libpath.c_str()); + status = EFAULT; + std::exit(status); + } if(handle) { -- libgit2 0.21.4