MinGW を使用して MSYS で netcat を構築しようとしたところ、MinGW が実際にはすべての BSD ソケットを Windows に移植していないことに気付きました (例: sys/socket.h)。MinGW で Windows ソケットを使用できることは知っていますが、BSD ソケットの Windows ポートを作成しなかったのはなぜですか? #ifdef を使用して問題を回避するプログラムがかなりあることに気付きました。代わりに使用できる BSD ソケットの Windows ポートはありますか?
MSYS で netcat の make を実行したときのエラーは次のとおりです。
gcc -DLOCALEDIR=\"\/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -c `test -f 'core.c' || echo './'`core.c
In file included from core.c:29:
netcat.h:38:24: sys/socket.h: No such file or directory
netcat.h:39:63: sys/uio.h: No such file or directory
netcat.h:41:24: netinet/in.h: No such file or directory
netcat.h:42:55: arpa/inet.h: No such file or directory
MinGW には #ifdef はありません。すべてをエラーなしでコンパイルするために MSYS に追加できるライブラリ/パッケージはありますか?