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了?
還有,直接貼代碼更好。不要給這些東西,雖然也能看出一點,但是還是感覺好難受。。
- 1 回答
- 0 關注
- 1689 瀏覽
添加回答
舉報
0/150
提交
取消