C#C
C#5mo ago
Stellar

✅ ILC AOT Analysis IL1005

So I'm working in a NativeAOT env, and I have this little chunk of code:
C++
[RuntimeImport("testGCC")]
extern static void* testGCC(void* a);

And that small two lines throws
ILC : AOT analysis error IL1005: Program.testGCC(Void*): Method will always throw because: Invalid IL or CLR metadata in 'Void* Program.testGCC(Void*)'


My code using said function is
C#
string test = "Hello from GCC";
        
fixed (char* p = test)
{
  char* result = (char*)testGCC(p);
  Canvas.DrawString(result, 0, 56, Color.White);
}


Any ideas?
Was this page helpful?