我在 mingw 上收到此错误:pr1.c 是文件名
我遇到了一些问题,然后像这样添加了库,但现在出现了这些错误:
$ gcc pr1.c -o pr1.exe -lwsock32 -lws2_32
pr1.c: In function 'main':
pr1.c:54:2: warning: incompatible implicit declaration of built-in function 'b
zero' [enabled by default]
C:\Users\rak\AppData\Local\Temp\ccMtb7Wt.o:pr1.c:(.text+0xc9): undefined refe
rence to `inet_pton'
C:\Users\rak\AppData\Local\Temp\ccMtb7Wt.o:pr1.c:(.text+0xe2): undefined refe
rence to `bzero'
C:\Users\rak\AppData\Local\Temp\ccMtb7Wt.o:pr1.c:(.text+0x1b5): undefined ref
erence to `bzero'
C:\Users\rak\AppData\Local\Temp\ccMtb7Wt.o:pr1.c:(.text+0x224): undefined ref
erence to `bzero'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: C:\Users\rak\AppData\Local\Temp\ccMtb7Wt.o: bad reloc address 0x20 in section `.eh_frame'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: final link
failed: Invalid operation
collect2.exe: error: ld returned 1 exit status