Hi, Not sure if this is the place to ask my question but here we go:
I am trying to build C++ code targeting the Android platform. I already have the whole system setup to generate VisualStudio projects and it is using the Nsight Tegra plug-in. I’ve been asked to update the CMake files so we can still target Android but not using VisualStudio in hope to migrate to AndroidStudio. So far, I managed to create a new toolchain file containing the following: set(CMAKE_SYSTEM_NAME Android) set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang) set(CMAKE_ANDROID_API 21) set(CMAKE_ANDROID_NDK $ENV{ANDROID_HOME}) set(CMAKE_ANDROID_SKIP_ANT_STEP 0) set(CMAKE_ANDROID_JAVA_SOURCE_DIR java) set(CMAKE_ANDROID_BUILD_SYSTEM GradleBuild) With these settings, I can successfully compile the whole project source files but when I get to the link pass, it fails with the error: C:/NVPACK/android-ndk-r10e/platforms/android-21/arch-arm/usr/lib/../lib\crtbegin_dynamic.o:crtbrand.c:function _start: error: undefined reference to 'main’ I believe that I am missing the equivalent steps that are taken care by the “Gradle Build” steps found in the VisualStudio project. My understanding is that these Gradle steps are responsible for embedding the AndroidManifest (that, I’ve been told, will define the ‘main’) and generate the apk file from the so. Is this indeed what I am missing? Also, can anyone confirm if CMake 3.7 does provide the equivalent steps or if I need to define them myself? Thank you in advance Regalir
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers