.NET Framework Bookmark and Share   
 index > Building Development and Diagnostic Tools for .Net > COR_ILMETHOD_DECODER and unresolved symbols
 

COR_ILMETHOD_DECODER and unresolved symbols

I am trying to useCOR_ILMETHOD_DECODER and for some reason the linker is unable to resolve the _DecoderInit sysbol referenced in it. I've added corguids.lib, but I haven't come up with a way to resolve the linker issue. Any ideas why the linker is unable to resolve it?

k.r.t.

Check your C++ compiler arguments. I don't have the same problem - this works on my machine (VS 2008 SDK environment %ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat):

cl.exe /Zi /FdHelloWorld.pdb /FeHelloWorld.exe HelloWorld.cpp "C:\Program Files\Microsoft SDKs\Windows\V6.0A\Include\corhlpr.cpp"

#include <stdio.h>
#include <corhlpr.h>

void main()
{
    COR_ILMETHOD_DECODER d((COR_ILMETHOD *)NULL);
    printf("Hello World");
}

Output (no errors):
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

HelloWorld.cpp
corhlpr.cpp
Generating Code...
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

/debug
/out:HelloWorld.exe
HelloWorld.obj
corhlpr.obj

All Replies

  • Wednesday, July 08, 2009 1:22 AMKarel ZikmundMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer

    I thinkyou need to compile corhlpr.cpp in your application (%ProgramFiles%\Microsoft SDKs\Windows\V6.0A\Include\corhlpr.cpp) which contains the implementation.
    I don't think that any library exposes it for linking.

    -Karel

  • Thursday, July 09, 2009 4:33 PMk.r.t. Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks that helps some! That allows each of the .objs to resolve the symbol but my project is still complaining of an unresolved external symbol _DecoderInit (LNK2001). Any ideas for that?
Karel Zikmund

You can use google to search for other answers

Custom Search

More Threads

• Managed assembly check
• "Failed to CoCreate profiler"
• Attaching to ASP.NET Worker Process
• IMetaDataEmit.DefineTypeRefByName for generic types?
• Debugger for Compact Framework - How to build
• Finding out IL instruction pointers from COR_PRF_FRAME_INFO
• Can I know how to get some sample class diagram for c# projects?
• hiiii. I need help
• How to capture Trace.WriteLine output via DbgView on Vista?
• Is there any way i can create custom rules in fxcop 1.35 for region declaratives and summary (///summary) tag