stephane / libmodbus

A Modbus library for Linux, Mac OS, FreeBSD and Windows
http://libmodbus.org
GNU Lesser General Public License v2.1
3.44k stars 1.75k forks source link

MinGW make error in unit-test-server.c #169

Closed ghost closed 10 years ago

ghost commented 10 years ago

when compiling the newest libmodbus master branch with the newest MinGW (GCC 4.8.1) on Win7 via the steps:

autogen.sh
./configure
make

make breaks with:

unit-test-server.c:24:24: fatal error: sys/socket.h: No such file or directory

it can be resolved by replacing in tests/unit-test-server.c line 24

#include <sys/socket.h>

with

#ifdef _WIN32
# include <winsock2.h>
#else
# include <sys/socket.h>
#endif
stephane commented 10 years ago

Thank you, I'll try to review your others PR ASAP!