我過得好MinGW的這個錯誤插座proram: pr1.c是錯誤MinGW的編譯時在Windows
我遇到了一些問題,像這樣加入庫,但現在遇到這些錯誤的文件名:
$ 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
現在只有1個錯誤即將到來,那也是「inet_top」,我無法解決它 –
@rahulkapoor,哪個錯誤即將到來?對於'inet_top',恐怕我無法幫助你,但是我連接的問題似乎有答案。如果你仍然無法解決這個問題,可以考慮在Windows中專門提出另一個關於'inet_top'的問題,提到你已經看到了我鏈接到的問題,但是它沒有解決你的問題。 – Shahbaz
是的,我在說「inet_ntop」。鏈接中提到了一個替代方案,但我仍然無法解決它。如何將其轉換爲「wsaStringToAddress」。我嘗試了各種方法,但無法解決。 –