Say you have following C++ code:
extern "C" {
void testA(int a, float b) {
}
static void testB(int a, float b){
}
}
I want to access this in my C# project using DllImport
:
class PlatformInvokeTest
{
[DllImport("test.so")]
public static extern void testA(int a, float b);
[DllImport("test.so")]
internal static extern void testB(int a, float b);
public static void Main()
{
testA(0, 1.0f);
testB(0, 1.0f);
}
}
This works perfectly fine for testA
, but testB
fails throwing an EntryPointNotFoundException.
Can I access testB
from my C# code? How?