I need an advice with Gradle multiplatform plugin....
# kotlin-native
l
I need an advice with Gradle multiplatform plugin. Using CInterops support I add a native library and should how can I reference it from main project? It keeps saying
...ld.lld: error: undefined symbol...
to what I have in native lib
d
Can I see the def file?
You're probably missing some
linkerOpts
.
l
def file
Copy code
package mylaps
headers = /opt/sdk-master/include/MylapsSDK.h
compilerOpts = -std=c99
and
Copy code
linkerOpts '-lmylaps -L/opt/sdk-master/lib/linux/x86-64/libmylapssdk.so -Xcheck-dependencies -verbose -o mylaps'
d
With your current config, do you get auto-complete in the IDE?
l
no
d
Where on your system is
mylaps.a
?
l
I have
libmylapssdk.so
only no
.a
file
m
Then linkerOpts should be
-lmylapssdk -L/opt/sdk-master/lib/linux/x86-64
l
thank you, but it did not help and ending with error
… error: undefined symbol: …
I see this in log
The Kotlin source set linuxX86 was configured but not added to any Kotlin compilation. You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
how to fix it?
I don’t see kotlin source generated from native code inside my kotlin native app