project-navigation
Personal tools

Author Topic: src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)  (Read 7735 times)

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)
« on: January 04, 2009, 03:05:29 pm »
I'll got this error under W2K

"The procedure entry point getaddrinfo could not be located in the dynamic link library WS2_32.dll"
MS tells us
http://support.microsoft.com/kb/955045
To execute an application using this function on earlier versions of Windows (Windows 2000, Windows NT, and Windows Me/98/95), then it is mandatary to #include Ws2tcpip.h and also Wspiapi.h.


net.c
Code: [Select]
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
# if WINVER < 0x501
#  include <wspiapi.h>
# else
#  include <ws2spi.h>
# endif
The problem here is if someone compile under XP
those pre XP headers where never includet
and so far the game will not run on pre XP systems

if i cange the code this way
Code: [Select]
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
//# if WINVER < 0x501
#  include <wspiapi.h>
//# else
//#  include <ws2spi.h>
//# endif
the game run fine on W2k
played a view hours now

'Couse im no coder and new
i dont know if this would do any harm on XP++

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)
« Reply #1 on: January 04, 2009, 04:21:33 pm »
I just tried this on my machine that I use to compile UFO: AI for Windows, running XP Home, and it wouldn't compile:

Code: [Select]
||=== ufo2map, windows_debug ===|
F:\Codeblocks-PrePk\MinGW\include\jconfig.h|25|warning: "HAVE_STDLIB_H" redefined|
F:\Codeblocks-PrePk\MinGW\include\SDL\SDL_config.h|67|warning: this is the location of the previous definition|
||=== ufo_ded, windows_debug ===|
F:\UFOai\src\common\net.c|44|wspiapi.h: No such file or directory|
||=== Build finished: 1 errors, 2 warnings ===|
||=== Build finished: 1 errors, 2 warnings ===|

(This is from Codeblocks IDE.)

I'm guessing XP Home doesn't include some things that would be needed to compile with W2K compatibility.

I'm not a veteran coder, but if I happen to be right is there somewhere I could download a library to include that would add W2K support with the change in this thread?

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)
« Reply #2 on: January 04, 2009, 06:38:55 pm »
F:\UFOai\src\common\net.c|44|wspiapi.h: No such file or directory|
You dont have the header file!

wspiapi.zip
Its from Microsoft Platform SDK for Windows Server 2003 R2

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)
« Reply #3 on: January 04, 2009, 07:04:36 pm »
Yeah, I figured I was missing something from some kind of Microsoft SDK or library or something...

I just tried the link - the 4shared site doesn't let me download anything, even after waiting.  I tried both Firefox and IE, and based on the error messages it gave me I don't think I can get anything from their site because of an incompatibility with my internet service and their systems.

Could you please try simply attaching the file directly to a post?  The forum software appears to be set to accept .ZIP files as attachments to posts (under "additional options" below the reply text box), and looking at the options it allows 4 per post up to 1024KB which should be more than enough.

(Sorry for the inconvenience.)

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)
« Reply #4 on: January 04, 2009, 10:22:18 pm »
4shared needs javascript (i know  ::))

Additional Options... well hidden (its late)

[attachment deleted by admin]

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: src\common\net.c && W2K (...getaddrinfo could not...WS2_32.dll)
« Reply #5 on: January 06, 2009, 09:46:21 am »
Made a quick test on my bart-XPE and found no problem
Game is working fine under w2k ans XP