次の C++ コードがあるとします。
extern "C" {
void testA(int a, float b) {
}
static void testB(int a, float b){
}
}
次を使用して、C#プロジェクトでこれにアクセスしたい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);
}
}
これは に対しては問題なく動作testA
しtestB
ますが、EntryPointNotFoundException のスローに失敗します。
testB
C# コードからアクセスできますか? どのように?