eclipse 构建 Android NDK 项目的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9697852/
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
Issue with build Android NDK project
提问by ArtKorchagin
I try to build project in Eclipse on Linux Ubuntu. Eclipse show error message:
我尝试在 Linux Ubuntu 上的 Eclipse 中构建项目。Eclipse 显示错误信息:
**** Build of configuration Default for project FFVideo ****
/home/art/android-ndk-r7b/ndk-build V=1
Cannot run program "/home/art/android-ndk-r7b/ndk-build": Unknown reason
Error: Program "/home/art/android-ndk-r7b/ndk-build" is not found in PATH
PATH=[/home/art/android-ndk-r7b:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]
**** Build Finished ****
Why it happened?
为什么会发生?
回答by gulati
You need to set the path to android ndk in eclipse.
1. Open C/C++ Perspective.
2. Right click on the project, and select "Properties"
3. Select C/C++ Build => Environment
4. Add PATH environment variable, include path to the android ndk.
需要在eclipse中设置android ndk的路径。
1. 打开 C/C++ 透视图。
2. 右键单击项目,然后选择“属性”
3. 选择 C/C++ Build => Environment
4. 添加 PATH 环境变量,包括 android ndk 的路径。
回答by xarlymg89
This worked for me, but I had to execute this command at the terminal, because the problem was with permissions.
这对我有用,但我必须在终端执行此命令,因为问题出在权限上。
sudo chmod 777 -R android-ndk-r8c/
须藤 chmod 777 -R android-ndk-r8c/
回答by Pei JIA
Yes, this works for me too...
是的,这也适用于我...
This seems to tell, Ecipse IDE uses PATH before .bashrc ? What I mean is: I've got PATH="$PATH:/opt/android-sdk-linux/tools/:/opt/android-sdk-linux/platform-tools:/opt/android-ndk-r8cin .bashrc, but Eclipse IDE uses PATH without android-sdk/android-ndk settings.
这似乎说明,Ecipse IDE 在 .bashrc 之前使用 PATH ?我的意思是:我有 PATH="$PATH:/opt/android-sdk-linux/tools/:/opt/android-sdk-linux/platform-tools:/opt/android-ndk-r8cin . bashrc,但 Eclipse IDE 使用没有 android-sdk/android-ndk 设置的 PATH。
A kind of weird to me....
对我来说有点奇怪......
回答by Kevin
I found the solution by adding the NDK-path to the path variable, in the ubuntu terminal as well as in eclipse. Then I had to DELETE THE ".cmd" in "ndk-build.cmd" because the terminal says that I have no permission with this file ending.
我通过在 ubuntu 终端和 eclipse 中将 NDK 路径添加到路径变量中找到了解决方案。然后我不得不删除“ndk-build.cmd”中的“.cmd”,因为终端说我没有这个文件结尾的权限。