4

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?

1
  • did you ever figure it out? Commented Dec 7, 2021 at 23:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.