如何在Linux中运行二进制文件 [英] How to run binary file in Linux

查看:209
本文介绍了如何在Linux中运行二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 commanKT 的文件,并希望在Linux终端中运行它.有人可以通过给出命令来运行此文件来提供帮助吗?我尝试了 ./commonRT ,但出现了错误:

 "bash:./commonrt:无法执行二进制文件"[blackberry @ BuildMc MainApp] $ ls -al commonKT-rwxrwxr-x.1 sijith sijith 10314053 2月27日16:49 commonKT 

解决方案

要执行二进制文件,请使用: ./binary_name .

如果出现错误:

bash:./binary_name:无法执行二进制文件

这是因为它是使用工具链编译的,该工具链的目标与您尝试对其运行二进制文件的目标不同.

例如,如果使用 arm-none-linux-gnueabi-gcc 编译'binary_name.c'并尝试在x86机器上运行生成的二进制文件,则会得到上述错误./p>

I have a file called commanKT and want to run it in a Linux terminal. Can someone help by giving the command to run this file? I tried ./commonRT but I'm getting the error:

"bash: ./commonrt: cannot execute binary file"

[blackberry@BuildMc MainApp]$ ls -al commonKT
-rwxrwxr-x. 1 sijith sijith 10314053 Feb 27 16:49 commonKT

解决方案

To execute a binary, use: ./binary_name.

If you get an error:

bash: ./binary_name: cannot execute binary file

it'll be because it was compiled using a tool chain that was for a different target to that which you're attempting to run the binary on.

For example, if you compile 'binary_name.c' with arm-none-linux-gnueabi-gcc and try run the generated binary on an x86 machine, you will get the aforementioned error.

这篇关于如何在Linux中运行二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆