简体   繁体   English

构建Android NDK项目的问题

[英]Issue with build Android NDK project

I try to build project in Eclipse on Linux Ubuntu. 我尝试在Linux Ubuntu上用Eclipse构建项目。 Eclipse show error message: 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? 为什么会这样?

You need to set the path to android ndk in eclipse. 你需要在eclipse中设置android ndk的路径。
1. Open C/C++ Perspective. 1.打开C / C ++ Perspective。
2. Right click on the project, and select "Properties" 2.右键单击项目,然后选择“属性”
3. Select C/C++ Build => Environment 3.选择C / C ++ Build => Environment
4. Add PATH environment variable, include path to the android ndk. 4.添加PATH环境变量,包含android ndk的路径。

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/ sudo chmod 777 -R android-ndk-r8c /

Yes, this works for me too... 是的,这对我也有用......

This seems to tell, Ecipse IDE uses PATH before .bashrc ? 这似乎告诉我,Ecipse IDE在.bashrc之前使用PATH? What I mean is: I've got PATH="$PATH:/opt/android-sdk-linux/tools/:/opt/android-sdk-linux/platform-tools:/opt/android-ndk-r8c in .bashrc, but Eclipse IDE uses PATH without android-sdk/android-ndk settings. 我的意思是:我有PATH =“$ PATH:/ opt / android-sdk-linux / tools /:/ opt / android-sdk-linux / platform-tools:/ opt / android-ndk-r8c in。 bashrc,但Eclipse IDE使用PATH而没有android-sdk / android-ndk设置。

A kind of weird to me.... 对我来说有点奇怪....

I found the solution by adding the NDK-path to the path variable, in the ubuntu terminal as well as in eclipse. 我通过在ubuntu终端以及eclipse中添加NDK路径到路径变量来找到解决方案。 Then I had to DELETE THE ".cmd" in "ndk-build.cmd" because the terminal says that I have no permission with this file ending. 然后我不得不在“ndk-build.cmd”中删除“.cmd”,因为终端说我没有权限使用此文件结束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM