Android 在 Eclipse 中为 ndk 程序设置构建路径

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11825534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:58:46  来源:igfitidea点击:

Set Build path in Eclipse for ndk program

androideclipseandroid-ndkbuildpath

提问by TamiL

This error was shown when I build a android application program in Eclipse:

我在 Eclipse 中构建 android 应用程序时显示此错误:

14:43:33 **** Incremental Build of configuration Default for project com.***.NDKDemo ****
ndk-build all 
Cannot run program "ndk-build": Unknown reason

Error: Program "ndk-build" not found in PATH
PATH=[/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]

14:43:33 Build Finished (took 16ms)

Please give me a solution to include the build path in Eclipse..

请给我一个解决方案,将构建路径包含在 Eclipse 中。

回答by Padma Kumar

//goto Preference AndroidNDKand choose your ndk location

//转到Preference AndroidNDK并选择您的 ndk 位置

enter image description here

enter image description here

or

或者

in your hidden .bashrc file add this below line

在您隐藏的 .bashrc 文件中添加以下行

export NDK_PATH=/home/padmakumar/android-ndk-r7b

回答by jgranie

If your NDK location is already set, the builder in the toolchain editor may be wrong. Go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.

如果您的 NDK 位置已经设​​置,则工具链编辑器中的构建器可能是错误的。转到项目属性,C/C++ Build | 工具链编辑器并选择 Android Builder 作为当前构建器。

回答by Lucifer

The path for ndk-build is not set in your case. Open your .bashsrc file ( from root folder, it will be in hidden format, so Edit Menu and selection Show Hidden Files ) with Editor, go to last line and add following code,

您的情况未设置 ndk-build 的路径。用编辑器打开你的 .bashsrc 文件(从根文件夹,它将是隐藏格式,所以编辑菜单并选择显示隐藏文件),转到最后一行并添加以下代码,

NDK_HOME=/opt/android-ndk-r8
export NDK_HOME

Now restart your Computer and try again. For more information see my this answer.

现在重新启动计算机并重试。有关更多信息,请参阅我的这个答案