_vcclrit.h is deprecated. What's the replacement?

I have an managed DLL that compiles fine in VS2003 but fails on Whidbey Feb CTP. I couldn't find any document about replacement for _vcclrit.h according to http://support.microsoft.com/ id=814472
Any advice

C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(23) : warning CRT1001: _vcclrit.h is deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(94) : warning C4996: '__lock_handle' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(133) : warning C4996: '__terminated' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(137) : warning C4996: '__initialized' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(151) : warning C4996: '__initialized' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(159) : warning C4996: '__lock_handle' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(177) : warning C4996: '__lock_handle' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(209) : warning C4996: '__initialized' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(213) : warning C4996: '__terminated' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(224) : warning C4996: '__terminated' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\_vcclrit.h(231) : warning C4996: '__lock_handle' was declared deprecated
.\DllInit.cpp(47) : warning C4996: '__crt_dll_initialize' was declared deprecated

DllInit.obj : error LNK2020: unresolved token (0A000012) __native_vcclrit_reason
DllInit.obj : error LNK2020: unresolved token (0A000013) __native_startup_state
DllInit.obj : error LNK2020: unresolved token (0A000014) __native_startup_lock


Answer this question

_vcclrit.h is deprecated. What's the replacement?

  • Thogek

    Any resolution to this problem   I am running into the same error and have beaten my head against the wall for some time.
  • Ricacho

    Hi BobD!
    This post has been edited either by the author or a moderator in the Microsoft Forums: http://forums.microsoft.com Any resolution to this problem   I am running into the same error and have beaten my head against the wall for some time.
    What problem

    If you have applied the suggested resolution for the loader-lock problem on your VC2003 project. You should remove it again!

    It is not longer needed (nor supported) in VC2005:

    Old KB-Article (which only applies to VC2002/2003 !!!):
    PRB: Linker Warnings When You Build Managed Extensions for C++ DLL Projects
    http://support.microsoft.com/ id=814472

    With VC2003 you simple must not use managed functions inside DllMain and you must link with the DLL-Version of the CRT.
    -- 
    Greetings
     Jochen
     
      My blog about Win32 and .NET
      http://blog.kalmbachnet.de/

  • whattapain

    Hi Moso!

    I still get this:

    DllInit.obj : error LNK2001: unresolved external symbol " .cctor@@$$FYMXXZ" ( .cctor@@$$FYMXXZ)
    DllInit.obj : error LNK2001: unresolved external symbol " .cctor@@$$FYMXXZ" ( .cctor@@$$FYMXXZ)

    Can you provide a simple example For me it works without any problem...
    By the way: starting with VC2005 you do not need to care about the "loader-lock" problem.
    It is no solved and you do not need to call "__crt_dll_initialize" and all other stuff manually!

    See:
    http://msdn.microsoft.com/chats/transcripts/vstudio/vstudio_091604.aspx
    http://msdn.microsoft.com/library/en-us/dnvs05/html/debgb1LdLk.asp
    -- 
    Greetings
     Jochen
     
      My blog about Win32 and .NET
      http://blog.kalmbachnet.de/

  • John Mathiasen

    My understanding is that the solution for Whidbey is to simply remove all the mixed-mode workarounds that you put in to make it work for Everett.  Under Whidbey it will "just work" like you wanted it to in the first place.


  • carso

    If I simply remark these 2 lines,

    //#include "_vcclrit.h"
      //__crt_dll_initialize();

    I still get this:

    DllInit.obj : error LNK2001: unresolved external symbol " .cctor@@$$FYMXXZ" ( .cctor@@$$FYMXXZ)
    DllInit.obj : error LNK2001: unresolved external symbol " .cctor@@$$FYMXXZ" ( .cctor@@$$FYMXXZ)


  • _vcclrit.h is deprecated. What's the replacement?