Đã cài đặt android-ndk-r7 và cố gắng biên dịch tệp .cpp.Không thể đưa iostream vào android tại sao?
#include <iostream>
using namespace std;
int main (int argc, char ** argv)
{
cout <<"Hello World.."<<endl;
}
đã thi lệnh sau: Got vào thư mục JNI, và thực hiện
#ndk-build
Got lỗi sau:
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp:1:20: error: iostream: No such file or directory
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp: In function 'int main(int, char**)':
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp:8: error: 'cout' was not declared in this scope
/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/jni/test1.cpp:8: error: 'endl' was not declared in this scope
make: *** [/home/jelari/Desktop/androidDevelopment/android-ndk-r7/DCF/obj/local/armeabi/objs/test1/test1.o] Error 1
am i làm gì sai?
tập tin của tôi Android.mk trông giống như:
# A simple test for the minimal standard C++ library
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test1
LOCAL_SRC_FILES := test1.cpp
include $(BUILD_EXECUTABLE)
và Application.mk tập tin trông giống như:
# Build both ARMv5TE and ARMv7-A machine code.
APP_ABI := armeabi armeabi-v7a
Vui lòng chỉ ra những sai lầm?
@Nick, xấu hổ về tôi :(. shoul d đã làm điều đó, thay vì gõ. Lấy làm tiếc!!. – Whoami
Ah ha ha ha ha - chúng tôi đã làm tất cả! – Nick