Does V currently support callback from C? #21374
Unanswered
susugagalala
asked this question in
Questions and Answers
Replies: 2 comments
-
The sample call_v_from_c directory from examples folder shows creating a shared library from a V source file containing export directives (similar to //export in Go). Can a static library or archive be created instead of a shared library? I tried passing -static in lieu of -shared but got an error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
https://github.com/vlang/v/blob/master/doc/docs.md#v-and-c the first example is calling sqlite from V, and providing a V callback (named |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to develop event-driven programs in V which calls a C toolkit which interacts with the user generating callbacks. The program captures these events by having those callbacks invoke user-written V functions. Is this currently possible with V?
Go supports this feature with cgo via the //export facility. If V has a similar facility or otherwise supports this callback mechanism, some code examples will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions