Unable to compile SDL-1.2.8 for VisualC

Inside the function “static int DX5_DInputInit(_THIS)” I am getting the
following compiler error under Windows with Visual C++ 6.0:

SDL_dx5events.c
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : warning
C4013: ‘GetAncestor’ undefined; assuming extern returning int
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : error
C2065: ‘GA_ROOT’ : undeclared identifier
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : warning
C4047: ‘=’ : ‘struct HWND__ *’ differs in levels of indirection from 'int ’

Any ideas?

Ken Rogoway <Ken HomebrewSoftware.com> writes:

Inside the function “static int DX5_DInputInit(_THIS)” I am getting the
following compiler error under Windows with Visual C++ 6.0:

SDL_dx5events.c
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : warning
C4013: ‘GetAncestor’ undefined; assuming extern returning int
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : error
C2065: ‘GA_ROOT’ : undeclared identifier
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : warning
C4047: ‘=’ : ‘struct HWND__ *’ differs in levels of indirection from 'int ’

Any ideas?

FYI:

This at line 172 in file sdl_dx5events.c:
topwnd = GetAncestor(SDL_Window, GA_ROOT);

Should be changed to:

#if WINVER >= 0x0500
topwnd = GetAncestor(SDL_Window, GA_ROOT);
#else
topwnd = SDL_Window;
#endif

The same is true down in the DX5_DInputReset() function.

Folk

googled error and found the following

#ifndef GA_ROOT
//#include <WINUSER.h>
// from WINUSER.h
/*

  • The “real” ancestor window
    */
    #define GA_MIC 1
    #define GA_PARENT 1
    #define GA_ROOT 2
    #define GA_ROOTOWNER 3
    #define GA_MAC 4

HWND
WINAPI
GetAncestor(
HWND hwnd,
UINT gaFlags
);
#endif
// end Gary Feng
to be added in sdl_dx5events.c

Cheers

Erwan

-----Message d’origine-----De : sdl-bounces+erwann.legoulven=in-fusio.com at libsdl.org
[mailto:sdl-bounces+erwann.legoulven=in-fusio.com at libsdl.org]De la part
de Ken Rogoway
Envoye : lundi 30 mai 2005 09:04
A : sdl at libsdl.org
Objet : [SDL] Unable to compile SDL-1.2.8 for VisualC

Inside the function “static int DX5_DInputInit(_THIS)” I am getting the
following compiler error under Windows with Visual C++ 6.0:

SDL_dx5events.c
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : warning
C4013: ‘GetAncestor’ undefined; assuming extern returning int
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : error
C2065: ‘GA_ROOT’ : undeclared identifier
c:\code\sdl-1.2.8\src\video\windx5\sdl_dx5events.c(171) : warning
C4047: ‘=’ : ‘struct HWND__ *’ differs in levels of indirection from 'int ’

Any ideas?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl