ghell
10-21-2008, 01:56 PM
Given my track record getting questions answered on here, I'm not holding my breath that anyone will reply to this. However, it can't hurt to ask.
I've run into a strange problem. I compiled zlib using the vs2005 project that comes with the source code into a static lib.
The static lib is zlib.lib while I also have the normal stub lib zdll.lib, for zlib1.dll that is available in compiled from from the zlib site.
I made a "Win32 Console" application and used the zlib.lib fine. I then made a "Win32 Project (Empty Project)" application and tried to use zlib.lib and it gave me the following error:error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj) MSVCRT.lib (same again for _free).
I switched to the dll and it makes the problem go away but I'd really like to use the lib to get rid of the dll, to make distribution of the exe easier (it needs no other dlls at all).
Does anyone know how I can get rid of this error and use the static lib in my "Win32 Project"?
I've run into a strange problem. I compiled zlib using the vs2005 project that comes with the source code into a static lib.
The static lib is zlib.lib while I also have the normal stub lib zdll.lib, for zlib1.dll that is available in compiled from from the zlib site.
I made a "Win32 Console" application and used the zlib.lib fine. I then made a "Win32 Project (Empty Project)" application and tried to use zlib.lib and it gave me the following error:error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj) MSVCRT.lib (same again for _free).
I switched to the dll and it makes the problem go away but I'd really like to use the lib to get rid of the dll, to make distribution of the exe easier (it needs no other dlls at all).
Does anyone know how I can get rid of this error and use the static lib in my "Win32 Project"?