locked
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'

    Question

  • I'm getting the following error when I try to build my C++ / CX WinRT component for ARM:

    error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in ColorSpc.obj

    The file ColorSpc.cpp is in the same project, which is not linking to any other libraries (other than the default).

    If I remove that file from the project, then the linker complains about the next .cpp file (and so on).

    I'm getting the same error whether I build Release or Debug (only the libraries mentioned are release or debug respectively).

    The project builds fine for Win32 and x64.

    Thursday, August 9, 2012 12:59 AM

Answers

  • We resolved the issue.  Seems we had the following in one of our header files to work around in issue with one of the earlier versions of VS 2012.

    // Define _STATIC_CPPLIB, otherwise you will get "unresoved linker error '__int64 const std::_BADOFF'" in VC2012
    #define _STATIC_CPPLIB
    #define _DISABLE_DEPRECATE_STATIC_CPPLIB  // disable warnings about defining _STATIC_CPPLIB
    

    This is no longer needed.

    • Marked as answer by BullyOwner Monday, August 13, 2012 4:02 PM
    Monday, August 13, 2012 4:02 PM

All replies

  • Hello,

    Would you please provide us the whole codes to reproduce this issue,

    You can upload your project to skydriver
    http://skydrive.live.com/

    It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, August 13, 2012 8:43 AM
  • We resolved the issue.  Seems we had the following in one of our header files to work around in issue with one of the earlier versions of VS 2012.

    // Define _STATIC_CPPLIB, otherwise you will get "unresoved linker error '__int64 const std::_BADOFF'" in VC2012
    #define _STATIC_CPPLIB
    #define _DISABLE_DEPRECATE_STATIC_CPPLIB  // disable warnings about defining _STATIC_CPPLIB
    

    This is no longer needed.

    • Marked as answer by BullyOwner Monday, August 13, 2012 4:02 PM
    Monday, August 13, 2012 4:02 PM