致命错误:dos / dos.h:没有这样的文件或目录

时间:2015-03-26 18:36:16

标签: android android-ndk dos

尝试使用NDK构建应用,但收到错误:

D:\AndroidProjects\SampleProject\Jmaster\src\main\jni\expat-2.0.1\amiga\expat_lib.c:24:21: fatal error: dos/dos.h: No such file or directory
make.exe: *** [D:\AndroidProjects\SampleProject\Jmaster\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/DeflatingDecompressor-v3/D_\AndroidProjects\SampleProject\Jmaster\src\main\jni\expat-2.0.1\amiga\expat_lib.o] Error 1
#include <dos/dos.h>
compilation terminated.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\android-ndk-r10d\ndk-build.cmd'' finished with non-zero exit value 2

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

你解决了吗? 我找到了解决方案,但我无法弄清楚.. 所以,我只是告诉过程 1.添加

android {    
    sourceSets.main {
        jni.srcDirs = []
    }
}

fbreadj模块的build.grade

  1. ndk-build模块的根目录中使用fbreadj
  2. 然后,将生成.so文件..

    有一些链接可能会帮助你:

    http://ph0b.com/android-studio-gradle-and-ndk-integration/ http://web.guohuiwang.com/technical-notes/androidndk1

    (原谅&忘记我可怜的英语.. :)