You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

编译链接完成后运行程序提示“-bash: ./animalprogram.bin: No such file or directory”的问题求助

编译链接完成后运行程序提示“-bash: ./animalprogram.bin: No such file or directory”的问题求助

各位大佬好!我最近在做一个用来演示C和汇编之间链接机制的简单教学项目,本来以为一切顺利——编译和链接过程都没报错,结果一运行生成的animalprogram.bin,终端就给我甩了个错误:-bash: ./animalprogram.bin: No such file or directory。我特意用ls确认过,这个文件明明就在当前目录里啊,实在搞不懂哪里出问题了,先来把我写的C代码贴出来,麻烦大家帮忙分析分析!

我的Cat.c代码

extern void sayHello(char*);
extern void makeSound(int);

void CatStuff(){
    int type = 0;
    char name[] = "Cat";

    sayHello(& name[0]);
    makeSound(type);
}

补充下背景:这个项目里我用汇编实现了sayHello和makeSound这两个外部函数,然后通过C代码调用它们,最后编译链接生成animalprogram.bin。编译链接的命令我反复检查过,过程中没有任何错误或警告输出,可就是运行不了,真的头大!有没有遇到过类似问题的朋友给我指条明路啊?

备注:内容来源于stack exchange,提问作者Charles Lentz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 16:49:29