简体   繁体   中英

Winsock2.h seems to be missing from mingw?

I have installed mingw on my arch linux distribution in order to cross compile windows applications. Everything seems to work fine, except when I include Winsock2:

x86_64-w64-mingw32-gcc -c -Wall  -o tcp.o tcp.c
tcp.c:14:24: fatal error: Winsock2.h: No such file or directory
#include <Winsock2.h>

What package do I miss?

The problem is that in linux, files paths are case sensitive. On Windows you can do:

#include <Winsock2.h>

while the actual file is C:/Path/To/Include/winsock2.h

On linux you have to do

#include <winsock2.h>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM