views:

285

answers:

1

I am developing a project which uses third party dlls and libraries. I want to build my project using static CRT (LIBCMTD) as I wish to run my application in "IBM purifier". However, the third party libraries are built using dynamic CRT(MSVCRT).

This gives linking error as: MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __mktime64 already defined in LIBCMTD.lib(mktime64.obj) MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __gmtime64 already defined in LIBCMTD.lib(gmtime64.obj) MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __localtime64 already defined in LIBCMTD.lib(loctim64.obj)

I have tried various linker settings. Also I gave /FORCE:MULTIPLE to the linker command line to ignore the multiple definitions and create a build. It did so, but my application stil not could run in purifier.

Is there a good way to do what I'm trying to achieve? I have no control over the 3rd party source code to control their settings.

Thanks

+1  A: 

If it needs to be built using only the static library, you're probably hosed -- their DLL is already configured to link to the standard library dynamically, and nothing you do in building the rest of the project is going to change that (unless you can get that vendor to supply a version that links to the standard library statically).

Jerry Coffin