root@hammerhead:/data/local # ./HelloWorld
tmp-mksh: ./HelloWorld: No such file or directory

Hello!

你好!

I compiled using gcc on Linux Deploy, which as I understand downloads Ubuntu and chroots into the environment. The file runs fine inside of this chroot environment.

我在Linux部署中使用gcc进行编译,据我所知,它将Ubuntu和chroots下载到环境中。该文件在这个chroot环境中运行良好。

As I understand this error is given when the file doesn't match the architecture of the machine. But it is running on the same machine! Does anyone know why this may be happening?

我理解这个错误是在文件与机器的架构不匹配时给出的。但它在同一台机器上运行!有人知道为什么会这样吗?


File permissions, ownership and context:

文件权限、所有权和上下文:

-rwxrwxrwx root  root  u:object_r:system_data_file:s0 HelloWorld

Id output:

Id输出:

uid=0(root) gid=0(root) context=u:r:init:s0

Using /system/bin/sh

使用/系统/ bin / sh

/system/bin/sh: ./Helloworld: No such file or directory

Trying to execute a non existant file:

尝试执行一个不存在的文件:

/system/bin/sh: ./test: not found

1 个解决方案

#1


2

You should compile your binary with gcc '-static' key. If you don't do that, you binary will need dynamic linker ld.so that doesn't exist on Android (but definitely exists inside your chroot!). This implies that strange error message "No such file or directory".

你应该用gcc的静态键来编译你的二进制文件。如果您不这样做,您的二进制文件将需要动态链接器ld。因此,Android上不存在动态链接器ld。这意味着奇怪的错误消息“没有这样的文件或目录”。

更多相关文章

  1. E/JavaBinder:FAILED BINDER TRANSACTION错误解决+RadioGroup调用
  2. 多个dex文件定义了Landroid/支持/v13/app/FragmentCompatICS。
  3. 解决:AndroidStudio 下使用AIDL不能生成对应java文件
  4. 尽管在清单文件中指定了权限,但是ACCESS_FINE_LOCATION SecurityE
  5. 错误:未使用的导入语句 - 导入android.widget.AdapterView.OnItem
  6. Android Web-View:将本地Javascript文件注入远程网页
  7. Ubuntu Android/Sdk/build-tools/23.0.3/aapt": error=2, 没有那
  8. 小米1出现的资源文件找不到问题!
  9. Android的Intel XDK构建错误

随机推荐

  1. 2007.12.10.几个与Android有关的网址
  2. Android利用调试器调试程序
  3. LinearLayout 和 RelativeLayout的属性对
  4. 老罗Android开发视频教程 (android解析xml
  5. android adb shell 命令大全
  6. Android VectorDrawable与SVG
  7. Android中margin和padding的区别
  8. Android学习路线图
  9. android 各种小项目
  10. Android流式布局FlowLayout