- 积分
- 11
贡献57
飞刀13 FD
注册时间2022-9-7
在线时间3 小时
扫一扫,手机访问本帖
|
本帖最后由 heima21 于 2022-9-27 12:19 编辑
我简单编写了个helloworld,执行时提提示cannot execute binary file: Exec format error,请教下是哪里配置问题?ubuntu版本 18 64位,a40i的OKA40i-C开发板
uname -a
Linux forlinx 5.4.0-70-generic #78~18.04.1-Ubuntu SMP Sat Mar 20 14:10:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
由于不能发图,所以粘贴了代码,请技术支持帮忙分析下,谢谢
test.c
int main(int argc, char **argv)
{
printf("hello world\n");
}
makefile
TARGET =test
DEST_DIR ?=_install
CC ?=arm-linux-gcc
build:
@$(CC) -o $(TARGET) test.c -lpthread
hold:
@echo "test hold[skip]"
install:
@mkdir -p $(DEST_DIR)
@cp $(TARGET) $(DEST_DIR)
uninstall:
@rm -fr $(DEST_DIR)/$(TARGET)
distclean: uninstall
@rm -fr $(TARGET)
@rm -fr _install
以下是a40开发板超级终端执行情况
# tftp -g -r a40i/v101/test 192.168.0.8 && chmod 777 test
# ls -l
total 4536
-rwxr-xr-x 1 root root 648 Nov 30 2021 script_parser.sh
-rwxrwxrwx 1 root root 8392 Sep 27 11:21 test
-rw-r--r-- 1 root root 2859895 Nov 30 2021 translate.mp4
-rw-r--r-- 1 root root 1764044 Nov 30 2021 wo.wav
# test
#
# ./test
-sh: ./test: cannot execute binary file: Exec format error
# uname -a
Linux A40i 3.10.65 #4 SMP PREEMPT Thu Mar 17 01:45:52 UTC 2022 armv7l GNU/Linux
#
|
|