Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: sys/socket.h: No such file or directory, x86_64-w64-mingw32 mode

I am trying to develop a program which depends on socket library, once i am trying to make it, it prompt me:

fatal error: sys/socket.h: No such file or directory
 #include <sys/socket.h>

My build environment: Windows 8.1 under Cygwin x64 version, Build target: x86_64-w64-mingw32 as the --host=x86_64-w64-mingw32 parameters.

Command Line: cfalgs=-m64 ./configure --prefix=/usr/

I am building the app which is using the GTK+ 2.0.

I am trying to find the find under the socket.h file under the patch: cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include\sys. It seems not exist at all.

So there is no x64 version MinGW socket lib??

like image 457
Jeffrey Ye Avatar asked Sep 09 '14 03:09

Jeffrey Ye


1 Answers

sys/socket.h is a POSIX/SUS header. MinGW is for building WinAPI executables. Either switch to building with Cygwin's GCC to get access to POSIX/SUS facilities, or switch to using WinAPI's winsock2.h instead.

like image 74
Ignacio Vazquez-Abrams Avatar answered Oct 18 '22 20:10

Ignacio Vazquez-Abrams