为了账号安全,请及时绑定邮箱和手机立即绑定

gcc 编译出错了

gcc max.o min.o hello.c



hello.c: In function ‘main’:
hello.c:18:16: warning: implicit declaration of function ‘max’; did you mean ‘main’? [-Wimplicit-function-declaration]
     int maxNum=max(a1,a2);
                ^~~
                main
hello.c:19:16: warning: implicit declaration of function ‘min’; did you mean ‘main’? [-Wimplicit-function-declaration]
     int minNum=min(a1,a2);
                ^~~
                main

正在回答

2 回答

gcc版本的问题   有些版本没有声明头文件的话,默认也是报错的  即hello.c里面没有声明max.h与min.h,建议使用更严谨的写法 也就是视频中有说的包含.h的方法

0 回复 有任何疑惑可以回复我~

能附上你的hello.c吗

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

gcc 编译出错了

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号