CImage linker problems. Please help!
-
Hello! I have a simple application done with VC++ (2003 .NET). I made simple dialog based application with some buttons (with resource editor). Now I want to do something with images and want to try cool code with CImage class. By MSDN documentation I have to to include
#include "afxstr.h" (I replaced <> with " so it can be seen in this post) #include "atlimage.h"
in that exact order. Project setting is "Use MFC in shared DLL". When I do this I get many linker errors likeLIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(isctype.obj) : error LNK2005: __isctype already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(strftime.obj) : error LNK2005: _strftime already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in msvcrtd.lib(MSVCR71D.dll) zlib.lib(minigzip.obj) : error LNK2005: _error already defined in webServer.lib(uemf.obj) msvcrtd.lib(MSVCR71D.dll) : e
-
Hello! I have a simple application done with VC++ (2003 .NET). I made simple dialog based application with some buttons (with resource editor). Now I want to do something with images and want to try cool code with CImage class. By MSDN documentation I have to to include
#include "afxstr.h" (I replaced <> with " so it can be seen in this post) #include "atlimage.h"
in that exact order. Project setting is "Use MFC in shared DLL". When I do this I get many linker errors likeLIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(isctype.obj) : error LNK2005: __isctype already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj) LIBCMTD.lib(strftime.obj) : error LNK2005: _strftime already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in msvcrtd.lib(MSVCR71D.dll) zlib.lib(minigzip.obj) : error LNK2005: _error already defined in webServer.lib(uemf.obj) msvcrtd.lib(MSVCR71D.dll) : e
all static libraries must use the same runtime libraries as your application. if you are using MFC in a DLL in your EXE, the .LIBs must all be built with the "multi-threaded DLL" setting; if you are using statically-linked MFC in your EXE, the .LIBs must all be built with the "multi-threaded" CRT. see the Code Generation option in the library's C/C++ Properties. Cleek | Image Toolkits | Thumbnail maker
-
all static libraries must use the same runtime libraries as your application. if you are using MFC in a DLL in your EXE, the .LIBs must all be built with the "multi-threaded DLL" setting; if you are using statically-linked MFC in your EXE, the .LIBs must all be built with the "multi-threaded" CRT. see the Code Generation option in the library's C/C++ Properties. Cleek | Image Toolkits | Thumbnail maker
I made sure that all files are compiled with "Use MFC in a Shared DLL" option and they all have "Multi-threaded Debug DLL (/MDd)" runtime library selected and I still have linker errors. If I comment includes
#include <afxstr.h> #include <atlimage.h>
there is no link errors anymore. Any idea? Regards, Rostfrei -
I made sure that all files are compiled with "Use MFC in a Shared DLL" option and they all have "Multi-threaded Debug DLL (/MDd)" runtime library selected and I still have linker errors. If I comment includes
#include <afxstr.h> #include <atlimage.h>
there is no link errors anymore. Any idea? Regards, RostfreiMay be Try with giving complete path.. ex: "..\afxstr.h" Nice talking to you. :-O
If you judge people, you have no time to love them. -- Mother Teresa