I'm going to ask this question, and then answer it myself. I'm, aware that its a newbie question, but as it took me approx. two days to find the correct answer, I'll post it anyway.
So much for disclaimers - this one is dedicated to all you newbies out there:
I've go an MFC project in VS 2010, and I needed to add some 3rd party static library. All went well, both projects compiled and my project managed to reference the library. Then, when I included some header file from the library in my project, I got numerous a linker warnings, about functions in the C Run-Time library, e.g.:
Warning 9 warning LNK4006: _sprintf already defined in libcmtd.lib(sprintf.obj); second definition ignored C:path\to\my\project\MSVCRTD.lib(MSVCR100D.dll)
Thinking 'what the hell', I tried running my project, and it did run, until it came across a code line which tried to write into some file using 'fostream', and then it crashed with some scary heap corruption exception.
Searching S.O., I came across some related issues, none of which exactly match my problem:
- Link libraries with dependencies in Visual C++ without getting LNK4006
- How do you build a debug .exe (MSVCRTD.lib) against a release built lib (MSVCRT.lib)?
I almost wrapped the external library in a dll, before I stumbled across the answer.