[strongSwan-dev] Compile for Windows 10

Andrey KomIssarov komissar.off.andrey at gmail.com
Thu Mar 29 17:53:28 CEST 2018


I'm trying to build StrongSwan 5.6.2 for windows 10 64bit using
MinGW32-gcc version 6.3.0 and I got several problems:

First error was in src/libstrongswan/utils/compat/windows.h in
function definition (line 423)
_CRTIMP errno_t strerror_s(char *buf, size_t size, int errnum);
The type errno_t was undefined and there was same function with same
arguments and return value type of int a bite futher, so I comment
this line.

Second error was in same file, in function definition (line 434)
static inline int strerror_r(int errnum, char *buf, size_t buflen)
There was already same function with same arguments in standart
library (string.h), so I decided to comment this too

Third error was again in windows.h just before the definition of
struct pollfd (line 396)
There was preprocessor condition  #if _WIN32_WINNT < 0x0600 , which
will happen for Windows XP, Windows Server 2003 or ealier OS.
It was very strange as someone managed to build strongswan on Windows7
So I also delete this preprocessor "if"

Afterwards there appeared errors in linker:
underfined reference of "getaddrinfo"
underfined reference of "freeaddrinfo"
underfined reference of "WSAPoll"
underfined reference of "GetModuleHandleEx"
underfined reference of "GetTickCount64"
and several more

My configure script:
CFLAGS="-g -O2 -Wall -Wno-pointer-sign -Wno-format-security \
        -Wno-format -mno-ms-bitfields \
        -I/c/mingw/include \
        -I/c/mingw/mingw32/opt/include \
        -I/c/mingw/msys/1.0/include" \
LDFLAGS="-L/c/mingw/lib \
         -L/c/mingw/msys/1.0/lib \
         -L/c/mingw/mingw32/opt/lib" \
./configure --disable-defaults --enable-monolithic --enable-static \
--enable-svc --enable-ikev2 --enable-ikev1  \
--enable-nonce --enable-pem --enable-pkcs1 \
--enable-x509 --disable-openssl --enable-socket-win \
--enable-kernel-wfp --enable-kernel-iph --enable-pubkey \
--enable-swanctl --with-swanctldir=swanctl \
--with-strongswan-conf=strongswan.conf \

Are there any experience how to build strongswan 5.6 for windows 10 ?

Thank you,
Komissarov Andrey.

More information about the Dev mailing list