I'm trying to call a native C/C++ void function form dart side via dart:ffi,
final Void Function(void) funcNativeStart =
nativeGuestLib
.lookup<NativeFunction<Void Function(void)>>("NativeStart")
.asFunction();
This gives me compiler error
The type 'Void Function(void)' must be a subtype of 'Void Function(void)' for 'asFunction'
I've played around with a few edits, such as
final Void Function() funcNativeStart =
nativeGuestLib
.lookup<NativeFunction<Void Function()>>("NativeStart")
.asFunction();
final Void Function(Void) funcNativeStart =
nativeGuestLib
.lookup<NativeFunction<Void Function(Void)>>("NativeStart")
.asFunction();
But the results are all similar to what I've got with the first version.
How to fix this?