Hi there, I would like to write something like this:
val fileSize = memScoped {
val statBuf = alloc<stat>()
val error = stat("/", statBuf.ptr)
statBuf.st_size
}
However, upon compilation I get:
unresolved reference: memScoped, unresolved reference: alloc (etc…)
Which libraries would I need to import in order to use C functions with Kotlin? Googling this problem provides a “libcurl” example which isn’t useful at all. It also instructs to create a “def” file and include a header in order to make use of a particular C library function. However, there is no information on how to use memscope.
I have created my own scripts in Kotlin in order to compile with kotlinc, and it includes all needed libraries for my project in a folder.
I would appreciate your help, meanwhile thanks for your time and patience.