Skip to content

Passing extended struct to c++ function #39718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Dec 9, 2019 · 2 comments
Closed

Passing extended struct to c++ function #39718

ghost opened this issue Dec 9, 2019 · 2 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi

Comments

@ghost
Copy link

ghost commented Dec 9, 2019

Hello.

I have this c++ Struct
image

And also a c++ function with the above struct paramter.
image

When trying to use the dart:ffi to call this function from a flutter plugin the VM raising an error
image

I defined the function in this way
image

And the DummyStruct looks like this
image

The call to the function is
image

Is there anything I'm doing wrong?

  • Dart SDK Version
    Flutter 1.12.16 • channel dev • [email protected]:flutter/flutter.git
    Framework • revision 37f9c54 (12 days ago) • 2019-11-27 11:33:38 -0800
    Engine • revision fad1b23c42
    Tools • Dart 2.7.0

  • Using Windows

@a-siva a-siva added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi labels Dec 10, 2019
@a-siva
Copy link
Contributor

a-siva commented Dec 10, 2019

/cc @dcharkes

@dcharkes
Copy link
Contributor

@BissacM Thanks for reporting.

Unfortunately, we do not support passing structs by value to functions yet. We are planning to add this in the future, exactly in the way that you tried to use it.

We're already tracking the feature in of #36730, I'm closing this duplicate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi
Projects
None yet
Development

No branches or pull requests

2 participants