[Medium] Program Linkage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stirman
    New Member
    • Mar 2014
    • 3

    #1

    [Medium] Program Linkage

    This is about program linkage.

    My objective is to execute a C code in C#.

    C++ -> C Linkage

    Code:
    cbuffy[0] = NULL;
    The above code compiles and execute correctly from this environment. But with a warning which I ignore.
    Code:
     warning C4047: '=' : 'char' differs in levels of indirection from 'void *'

    C# -> Marshal -> C++ -> C Linkage

    Code:
    cbuffy[0] = NULL;
    The above code does not compile and gives me an error. This is the error.
    Code:
    : error LNK2001: unresolved external symbol ___report_rangecheckfailure
    When I change the C code to...
    Code:
    cbuffy[0] = ' ';
    It will compile correctly from this environment but it will throw an access violation in a structure related to the code assignment above.

    Any solution or hint?

    Thanks in advance.
  • stirman
    New Member
    • Mar 2014
    • 3

    #2
    Solved. Please close. Thank you.

    Comment

    Working...