Search code examples
c#c++-climanaged

Error C2143: missing ';' before '->'


I've searched here and the internet and no one seems to be having a similar problem to me and I can't quite figure out why I cannot get this to work.

The line that is preventing me from compiling is:

LitCiterCommon::LitCiterTrace->Init();

If I call LitCiterTrace.Init() from a different file (c#) it compiles just fine, but for some reason I cannot call it from managed cpp.

Any ideas or suggestions?


Solution

  • If Init is a static method then it would not be any different than in C++:

    // this is no different than calling a static member method in C++
    LitCiterCommon::LitCiterTrace::Init();