-
Hi, I've created my own static library. Is it possible to call lib functions in |
Beta Was this translation helpful? Give feedback.
Answered by
edubart
Nov 24, 2020
Replies: 2 comments
-
It is possible, using a dynamic or static library shoud be the same, you need to import its C functions, see how to do that in the C interoperability section in the overview. As an example, suppose you have ## cinclude 'mylib.h'
## linklib 'mylib'
## cflags '-I. -L.' -- tells the C compiler to look for include and library files in the current folder
local function mylib_func() <cimport, nodecl> end
mylib_func() -- call the library function |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
edubart
-
Thank you. |
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
It is possible, using a dynamic or static library shoud be the same, you need to import its C functions, see how to do that in the C interoperability section in the overview.
As an example, suppose you have
mylib.a
andmylib.h
in the current folder, that declares the functionmylib_func
:Also related issues with similar question are #32 and #30.