I am trying to build native application to use it just from command line (adb shell). I have tried to build it using ndk-build (without creating project). Here is my code Application.mk
APP_ABI := all
Application.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test.and
LOCAL_SRC_FILES := main.cpp
LOCAL_CPPFLAGS := -std=gnu++0x -Wall # whatever g++ flags you like
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog # whatever ld flags you like
include $(BUILD_EXECUTABLE) # <-- Use this to build an executable.
main.cpp
#include <stdio.h>//for printf
#include <stdlib.h>//for exit
int main(int argc, char **argv)
{
int i = 1;
i+=2;
printf("Hello, world (i=%d)!\n", i);
return 0;
exit(0);
}
And I am getting next errors
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/home/crosp/.AndroidStudioBeta/android-ndk-cr/build/core/build-local.mk:130: *** Android NDK: Aborting . Stop.
Is there any way to compile this without creating project, I don't need project at all, I am just want to write native application without GUI and using native code in Java applications. Thanks for help in advance.