I am using two different third party libraries in my VC++ project . When I compile them then its giving me linking errors.
I have checked the sample applications with each of the library. Settings of sample application with first library (Lib1)
- 1)Use MFC in Static Library
- 2)Multi-Threaded Debug
Settings of sample application with first library (Lib2)
- 1)Use MFC in a shared dll
- 2)Multi-Threaded Dll
I am including first library in project by adding
#pragma comment(lib, "./lib/abc.lib")
statement
Second library is added to project settings by adding it as Additional Dependencies.
Now it works fine but when I try to use some functions from Lib1 the I get errors like
1>libcmtd.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in msvcrtd.lib(MSVCR80D.dll) 1>libcmtd.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in msvcrtd.lib(MSVCR80D.dll) 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR80D.dll) 1>libcmtd.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrtd.lib(MSVCR80D.dll)
Any solution how can I make my project compile with both the libraries. I dont have source code for those libraries so I can't compile them.