亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

請問為什么報錯呢?

請問為什么報錯呢?

C
黑丶雨 2016-06-07 16:01:55
tuolei717@ubuntu:~/gaoxiang/Les2$ lshello.c? max.c? max.o? min.c? min.otuolei717@ubuntu:~/gaoxiang/Les2$ gcc max.o min.o hello.chello.c: In function ‘main’:hello.c:6:13: warning: implicit declaration of function ‘max’ [-Wimplicit-function-declaration]? int maxNum=max(a1,a2);???????????? ^hello.c:7:13: warning: implicit declaration of function ‘min’ [-Wimplicit-function-declaration]? int minNum=min(a1,a2);???????????? ^min.o: In function `max':min.c:(.text+0x0): multiple definition of `max'max.o:max.c:(.text+0x0): first defined here/tmp/ccH2K457.o: In function `main':hello.c:(.text+0x3d): undefined reference to `min'collect2: error: ld returned 1 exit statustuolei717@ubuntu:~/gaoxiang/Les2$
查看完整描述

1 回答

?
不偏不易

TA貢獻96條經驗 獲得超118個贊

有段時間沒寫C了,但是,大概是這樣的問題。

對max有多個定義

對min沒有定義

你看一下寫這兩個的時候是不是復制黏貼了?然后忘記把其中一個max改成min了?

還有,直接貼代碼更好。不要給這些東西,雖然也能看出一點,但是還是感覺好難受。。

查看完整回答
反對 回復 2016-06-07
  • 1 回答
  • 0 關注
  • 1689 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號