Hi, everyone. I am trying to get up and running w...
# kotlin-native
h
Hi, everyone. I am trying to get up and running with Kotlin/Native, using GLFW3, but I have a few questions and I find the pages on Github and KotlinLang a bit confusing. I have already built the GLFW3 Source into .A files, which are located in ~/Downloads/glfw/src/libglfw.a The example on gitchurn has this following def file:
Copy code
headers = git2.h
linkerOpts.osx = -L/opt/local/lib -L/usr/local/lib -lgit2
linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -lgit2
headerFilter = git2/** git2.h
Why is this using .h files? And if I have .a files what reference should I follow to get it working?
From what I have been able to gather, here is what I have gotten: build.gradle: https://hastebin.com/ocuduwipid.gradle def file: path: src/cinterop/glfw3.def file:
Copy code
headers = glfw3.h
staticLibraries = libglfw3.a
libraryPaths = /Users/32350/Downloads/GLFW
compilerOpts = /Users/32350/Downloads/GLFW
that path: Downloads/GLFW:
message has been deleted
o
C, unlike Java have separate binary artifacts (binary .a) and linking information (textual .h), so to generate Kotlin bindings (,klib) we need both.
h
Alright. I did aa lot of googling and reading and I got it working
my header file looks like this:
Copy code
package = glfw
headers = GLFW/glfw3.h
compilerOpts=-I/usr/local/include
linkerOpts= -lGLFW -L/usr/local/lib
, but im not sure what that -l and -I, and the -L means.
d
-I
is the folder where
.h
files are searched for. The I stands for include. Similarly the
-L
(that stands for library) indicates folders to search for libraries
.a
files in unix or
.lib
on windows. The
-l
lower case is for libraries too, but indicates the library to be loaded found in the specified folders. When specifying
-lGLFW
it will search for a
libGLFW.a
file in
/usr/local/lib
in your case. And in your case the the include would be loaded from
/usr/local/include/GLFW/glfw3.h
h
i see. thanks for the clear explaination