[Solved]NDK Compiling error


#1

Hi

I am using NDK r15c, while compiling for android I got this error

Android NDK: ERROR:/MyProject/cocos2d/external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /MyProject/cocos2d/external/freetype2/prebuilt/android/x86_64/libfreetype.a exists or that its path is correct

So I add APP_ABI := armeabi in my Application.mk
Now, above issue got fixed, but I got another error when I compile

[armeabi] Compile++ thumb: cocos2dxandroid_static <= ProcessCpuTracker.cpp
/MyProject/cocos2d/cocos/platform/android/jni/ProcessCpuTracker.cpp: In function ‘std::vector<_CpuInfo> readProcStat()’:
/MyProject/cocos2d/cocos/platform/android/jni/ProcessCpuTracker.cpp:69:54: error: ‘read’ was not declared in this scope
const int len = read(fd, buffer, sizeof(buffer)-1);
^
/MyProject/cocos2d/cocos/platform/android/jni/ProcessCpuTracker.cpp:70:13: error: ‘close’ was not declared in this scope
close(fd);

cocos2dx version is 3.15.1
Platform: Mac


#2

I will have a try with NDK r15c.


#3

I use NDK r15c to compile cpp-empty-test with latest github codes, not meet compiling error. I will try v3.15.1.


#4

Yep, it has problem in v3.15.1. You can just remove ProcessCpuTracker.cpp out of cocos/platform/android/Android.mk. The file is useless.


#5

Thanks

Now its working after removing ProcessCpuTracker.cpp from Android.mk