Comments (4)
.ref
is an extension method, not an instance method: https://api.dart.dev/stable/3.0.5/dart-ffi/StructPointer/ref.html
Even methods that are instance methods in dart:ffi
are often prohibited to be used from dynamic
. The reason is that we need to "see" the dart:ffi
uses at compile time because it uses a special compilation.
Why do you want to use dynamic
? Why not use final testClass = createClass()
(or var testClass = ...
) and have static typing without having to write the type?
from ffi.
I found same issue 123
My understanding is that class is not part of ABI, so change class to struct from header file.
Is it right?
BTW, static variable ( using final ) returns same error.
from ffi.
I found same issue 123
This is a different issue from what you were asking earlier, correct?
Earlier you were asking about using dynamic
in Dart, and now you are asking about C++ classes
with FFI.
My understanding is that class is not part of ABI, so change class to struct from header file.
Is it right?
Correct, struct
s are a C concept.
BTW, static variable ( using final ) returns same error.
The same as dynamic
? That is very weird because with final
it should have the correct type and be able to resolve .ref
to the extension method.
from ffi.
Alright, I try to change it.
And since ### final cannot find a correct type, I think return the same error.
Anyway, thanks to help me I appreciate it.
from ffi.
Related Issues (20)
- How to include dynamic library in dart package HOT 2
- missing SSL_CTX_set1_curves_list HOT 2
- Keep supporting Flutter 2 HOT 4
- How to C native call the dart function of the uint8list datatype? HOT 6
- Question: issues with returning C-string HOT 4
- FormatException when C returns string with non-ASCII character
- Inconsistent FFI Behavior with C Struct HOT 1
- Pass a Dart_PersistentHandle list / buffer from C to Dart? HOT 7
- Unable to load .so library in flutter using platform android emulator HOT 4
- Finalizing typed list to free its native memory HOT 2
- Rename `master` to `main` HOT 4
- Is `Utf8` equivalent to `ffi.Char`? HOT 4
- Invocation native function of namespace PlatformConfigurationNativeApi HOT 2
- The C callback function registered through ffi invalidates both asynchronous operations and timers during the callback HOT 2
- How to pass a Dart function to C? A GNU Scientific Library example. HOT 2
- Runtime error for Pointer.fromFunction(). Not sure if error is valid. HOT 2
- How to use dart ffi gen with multiple dynamic libraries? HOT 4
- The ffi example runs slowly on Android in release mode.
- The specified language version is too high. The highest supported language version is 3.2 HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffi.