Error compiling 1418
Posted: Fri Aug 21, 2015 5:05 pm
Two days ago I downloaded the source from SVN and attempted to compile in VS2013, however the below error occurs for socketaddress.cpp
Below is lines 123 - 133 of socketaddress.cpp
I've tried compiling this on both a Windows 10 machine and Windows 7 machine , both 64bit. I was able to get it to compile by editing the last few lines of socketaddress.cpp to the below (which is just a copy of the code from above it at the start of the if/then statement).
I program in vb.net and can follow C# and Java to some extent, but C++ not so much.
Just wanted to throw that out there, maybe theres something I'm missing, but I have been able to compile and set the VGO server.
Which brings me to something else I noticed, with the vgo-world.xml file. The server settings in the file ask for externalIP= , however using this I can never fully connect to my server (hangs at waiting for data). Leaving the externalIP empty works for local connections, and changing externalIP= completely to worldaddress= seems to work just fine
Code: Select all
socketaddress.cpp(126): error C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1> c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1868) : see declaration of 'inet_ntoa'
Code: Select all
#else
if (addr.sa_family == AF_INET) {
if (include_port)
sprintf(addr_str, "%s:%d", inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr), GetPort());
else
sprintf(addr_str, "%s", inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr));
return addr_str;
}
return "< IPv6 in early versions of Windows not supported! >";
#endif
I've tried compiling this on both a Windows 10 machine and Windows 7 machine , both 64bit. I was able to get it to compile by editing the last few lines of socketaddress.cpp to the below (which is just a copy of the code from above it at the start of the if/then statement).
I program in vb.net and can follow C# and Java to some extent, but C++ not so much.
Code: Select all
#else
char buf[sizeof(addr_str)];
if (addr.sa_family == AF_INET) {
if (include_port)
sprintf(addr_str, "%s:%d", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf)), GetPort()); // was inet_ntoa
else
sprintf(addr_str, "%s", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf))); // was inet_ntoa
return addr_str;
}
return "< IPv6 in early versions of Windows not supported! >";
#endif
Which brings me to something else I noticed, with the vgo-world.xml file. The server settings in the file ask for externalIP= , however using this I can never fully connect to my server (hangs at waiting for data). Leaving the externalIP empty works for local connections, and changing externalIP= completely to worldaddress= seems to work just fine