You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the compilation of Godot 4, the build will run fine until it reaches the compiling of the upnp module which will fail due to a incompatible pointer type error.
Here is the error:
thirdparty/miniupnpc/src/connecthostport.c: In function 'connecthostport':
thirdparty/miniupnpc/src/connecthostport.c:213:59: error: passing argument 4 of 'setsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
213 | if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)) < 0)
| ^~~~~~~~
| |
| struct timeval *
In file included from thirdparty/miniupnpc/src/connecthostport.c:18:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:1035:88: note: expected 'const char *' but argument is of type 'struct timeval *'
1035 | WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen);
| ~~~~~~~~~~~~^~~~~~
thirdparty/miniupnpc/src/connecthostport.c:219:59: error: passing argument 4 of 'setsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
219 | if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(struct timeval)) < 0)
| ^~~~~~~~
| |
| struct timeval *
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:1035:88: note: expected 'const char *' but argument is of type 'struct timeval *'
1035 | WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen);
| ~~~~~~~~~~~~^~~~~~
[Initial build] Compiling thirdparty/vhacd/src/vhacdICHull.cpp ...
scons: *** [thirdparty/miniupnpc/src/connecthostport.windows.editor.x86_64.o] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:02:55.764]
akien-mga
changed the title
Godot 4.x will not build with MinGW via cross-compilation. (Linux -> Windows)
miniupnpc build failure with -Wincompatible-pointer-types with Fedora 40's MinGW / GCC 14
Feb 18, 2024
WINAPI have this function defined with the buffer argument as const char * instead const void * on Linux, should be enough to add casts (which most of the code do). But I'm not sure why it was not an issue before.
Tested versions
Reproduced in SCons v4.x and Godot v4.1.3 Stable and v4.2.1 Stable.
System information
Fedora 40 "Rawhide" - Godot 4.1.3 Stable/Godot 4.2.1
Issue description
During the compilation of Godot 4, the build will run fine until it reaches the compiling of the
upnp
module which will fail due to a incompatible pointer type error.Here is the error:
I don't know if this is a MinGW issue or a bug.
Here is the version of MinGW I'm using:
Steps to reproduce
7f1be82d412f
)Minimal reproduction project (MRP)
N/A, compile issue.
The text was updated successfully, but these errors were encountered: