某些應用程序需要glob.c用於路徑例程,雖然它在android ndk 9中不存在。我嘗試移植https://code.google.com/p/tesseract-android-tools/source/browse/tesseract-android-tools/jni/com_googlecode_tesseract_android/#com_googlecode_tesseract_android%2Fglibc,它不起作用。我的意思是:Android上缺失和無法運行glob.c
const char *tmp = "/data/data/name.antonsmirnov.android.myapp/sdk/";
glob(tmp, GLOB_MARK, 0, &glob_results);
fprintf(stderr, "gl_pathc = %i\n", glob_results.gl_pathc);
它打印glob_results.gl_pathc = 0,雖然該文件夾存在:
MBA-Anton:platform-tools asmirnov$ ./adb shell ls /data/data/name.antonsmirnov.android.myapp/sdk/
binutils-compact#2.23#1
cppcheck#1.64a#1
gcc#4.8#2
libclang#3.3#1
libcloog#0.18.0#1
libgcc-compact-dev#4.8#1
libgmp#5.0.5#1
libisl#0.11.1#1
libmpc#1.0.1#1
libmpfr#3.1.1#1
libstdc++-compact-dev#4.8#1
ndk-sysroot-16#r9c#1
是否有任何工作glob.c或什麼是這一個問題?
更新:我也嘗試與犯錯的功能,但它不被調用:
int glob_error(const char *message, int error) {
std::cout << "glob error: " << message << "\n";
return 1;
}
// ...
glob(tmp, GLOB_MARK, &glob_error, &glob_results);