How to call C++ class Method in flutter

Viewed 198

I'm testing how to call a member limit in a c++ class from flutter.

I did how to call a C file via Flutter official documentation. but, I want to call a function inside a Class in C++ from flutter.

-C function call

extern "C" __attribute__((visibility("default"))) __attribute__((used))
int add_native(int n1, int n2)
{
    return n1 + n2;
}

-C++ class method

int ClassName::add_native(int n1, int n2)
{
    return n1 + n2;
}

If you do it in the same way as a C function call, you will get an error saying that the function cannot be found.

Do you know how to solve the problem?

0 Answers
Related