Error making SDL.mak

I’m trying to make SDL.mak under Borland’s Compiler included in BuilderX, but it
stops here:

…\src\video\windib\SDL_dibevents.c:
Error E2342 …\src\video\windib\SDL_dibevents.c 189: Type mismatch in paramet
er ‘lpPrevWndFunc’ (wanted ‘int (__stdcall *)()’, got ‘long (__stdcall *)(void *
,unsigned int,unsigned int,long)’) in function DIB_HandleMessage
*** 1 errors in Compile ***

Any suggestions?

Stefan,

I’m guessing it’s complaining about HWND define. I guess that borland’s
windows API has HWND defined as an int… where VC is a long.

As a quick test you could type cast it like this
change line 189 in file SDL_dibevents.c from
return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
to
return CallWindowProc((int)userWindowProc, hwnd, msg, wParam, lParam);

at least thats what it appears the compiler is complaining about.

Thx
VOn May 27, 2004 01:53 pm, Stefan wrote:

I’m trying to make SDL.mak under Borland’s Compiler included in BuilderX,
but it stops here:

…\src\video\windib\SDL_dibevents.c:
Error E2342 …\src\video\windib\SDL_dibevents.c 189: Type mismatch in
paramet er ‘lpPrevWndFunc’ (wanted ‘int (__stdcall *)()’, got ‘long
(__stdcall *)(void * ,unsigned int,unsigned int,long)’) in function
DIB_HandleMessage
*** 1 errors in Compile ***

Any suggestions?


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

Stefan,

I’m guessing it’s complaining about HWND define. I guess that borland’s
windows API has HWND defined as an int… where VC is a long.

As a quick test you could type cast it like this
change line 189 in file SDL_dibevents.c from
return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
to
return CallWindowProc((int)userWindowProc, hwnd, msg, wParam, lParam);

at least thats what it appears the compiler is complaining about.

Thanks for help!

I’ve casted userWindowProc to int (__stdcall *)() and it works. The same had to
be done in SDL_dx5events.c. But I get another error:

“D:\Programy\Borland\CBUILD~2\bin…\BIN\ilink32 @MAKE0000.@@@
Turbo Incremental Link 5.65 Copyright © 1997-2002 Borland
Error: Unresolved external ‘_SDL_HasMMX’ referenced from C:\SDL\SRC\VIDEO
SDL_BLIT_N.OBJ”

Any ideas?

I’ve already found the solution.
http://article.gmane.org/gmane.comp.lib.sdl/15275/match=sdl+hasmmx