Windows problems with SDL/COM

Hello,
I’m just starting out on SDL (from Allegro).

Everything is going fine and apps. are being generated ok (i.e. my setup and
project settings are fine), but my problem is this: I’m creating a Windows
COM library for using SDL via VB, etc (using the COM ATL) (I’m using the
correct multi-threaded run-time library), but get the following errors.

MSVCRT.lib(MSVCRT.dll) : error LNK2005: XXX already defined in StdAfx.obj

  • Where XXX is _free, _malloc, _realloc,

Anyone any idea how to get rid of them. I’m assuming that SDL has already
defined these functions but STDAFX has also.

I also had to remove the ‘#define main SDL_main’ (in SDL_Main.h) which I
assume is ok as COM uses its own main.

Thanks.

Neil.********************************************************************

This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person
Thank you

Check us out at http://www.syntegra.com


Neil.WALKER at syntegra.com wrote:

MSVCRT.lib(MSVCRT.dll) : error LNK2005: XXX already defined in
StdAfx.obj

  • Where XXX is _free, _malloc, _realloc,

Anyone any idea how to get rid of them. I’m assuming that SDL has
already defined these functions but STDAFX has also.

Perhaps try adding msvcrt.lib to the Ignored libraries list in MSVC. You
should find it on the Link tab in the Project options I think, or use
MSDN to find out how to do this if you’re using makefiles.–
Kylotan