1. 程式人生 > >解決ndk-build : fatal error: 'iostream' file not found

解決ndk-build : fatal error: 'iostream' file not found

出錯資訊如下:

./helloworld.h:1:10: fatal error: 'iostream' file not found #include <iostream>          ^~~~~~~~~~ 1 error generated. make: *** [obj/local/armeabi-v7a/objs/helloworld/helloworld.o] Error 1

 原因:ndk-build階段找不到標準庫函式

解決方法:在Application.mk檔案中指定標準庫檔案巨集APP_STL := c++_static

ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk APP_BUILD_SCRIPT=Android.mk

編譯通過