tuolei717@ubuntu:~/gaoxiang/Les2$ ls
hello.c max.c max.o min.c min.o
tuolei717@ubuntu:~/gaoxiang/Les2$ gcc max.o min.o hello.c
hello.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 status
tuolei717@ubuntu:~/gaoxiang/Les2$
不偏不易
相关分类