How would I specify a relative path when linking a...
# kotlin-native
k
How would I specify a relative path when linking a static library within
libraryPaths
?
Copy code
headers = foo.h
staticLibraries = libfoo.a
libraryPaths = /some/relative/path
The documentation on this seems to only cover absolute paths and there's no further mention of
libraryPaths
anywhere else. https://kotlinlang.org/docs/native-c-interop.html#include-a-static-library-in-your-klib
n
Relative paths can be used, although they have to start from the project directory. Basically this means all header and/or library files have to be located somewhere in the project directory, if relative paths are used.
k
Perfect. I assume the
.
in the relative path corresponds to where the root gradle build file is declared?
n
With relative paths in a shell the
.
character is based on the current working directory, which isn't applicable to Kotlin Native def files.