1.编译环境--windows7的 MSYS2 中mingw64 编译环境,strongswan版本为 5.6.3
2.使用的./configure 配置如下:
./configure --disable-defaults --enable-monolithic --enable-static \
--enable-svc --enable-ikev2 --enable-ikev1 \
--enable-nonce --enable-pem --enable-pkcs1 \
--enable-x509 --enable-openssl --enable-socket-win \
--enable-kernel-wfp --enable-kernel-iph --enable-pubkey \
--enable-swanctl --with-swanctldir=swanctl \
--with-strongswan-conf=strongswan.conf --host=x86_64-w64-mingw32
3.当编译到strongswan-5.6.3\src\libstrongswan\plugins\openssl\openssl_ec_private_key.c 时发生错误如下:
/bin/sh ../../../../libtool --tag=CC --mode=compile x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../src/libstrongswan -DFIPS_MODE=0 -I/mingw64/include -g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign -mno-ms-bitfields -include /d/strongswan-5.6.3/config.h -c -o openssl_ec_private_key.lo openssl_ec_private_key.c
libtool: compile: x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../src/libstrongswan -DFIPS_MODE=0 -I/mingw64/include -g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign -mno-ms-bitfields -include /d/strongswan-5.6.3/config.h -c openssl_ec_private_key.c -DDLL_EXPORT -DPIC -o .libs/openssl_ec_private_key.o
In file included from D:/MYSYS-64-SOURCE/mingw64/x86_64-w64-mingw32/include/windows.h:95,
from D:/MYSYS-64-SOURCE/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
from ../../../../src/libstrongswan/utils/compat/windows.h:24,
from ../../../../src/libstrongswan/utils/utils.h:39,
from ../../../../src/libstrongswan/library.h:101,
from ../../../../src/libstrongswan/credentials/builder.h:41,
from openssl_ec_private_key.h:26,
from openssl_ec_private_key.c:21:
D:/MYSYS-64-SOURCE/mingw64/include/openssl/x509.h:83:34: error: expected ')' before numeric constant
83 | typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
4.其中的 mingw64/include/openssl/x509.h 是 mingw64 自身安装的 openssl
5.如何去除 MYSYS-64-SOURCE/mingw64/include/openssl/x509.h:83:34: error: expected ')' before numeric constant 这个问题?