https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
k

kevin.cianfarini

12/21/2022, 9:38 PM
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

napperley

12/21/2022, 10:33 PM
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

kevin.cianfarini

12/21/2022, 11:12 PM
Perfect. I assume the
.
in the relative path corresponds to where the root gradle build file is declared?
n

napperley

12/28/2022, 10:01 PM
With relative paths in a shell the
.
character is based on the current working directory, which isn't applicable to Kotlin Native def files.
15 Views