I'm probably missing a dependency but it seems lik...
# multiplatform
a
I'm probably missing a dependency but it seems like the java libraries are not showing up in my kotlin multiplatform project. Having issues importing things like System for System.loadLibrary. Any idea on what I'm missing?
j
Is this in src/jvmMain/kotlin/? Or src/commonMain/kotlin/?
a
I have it in src/nativeMain/kotlin/
j
System is a JVM class and will only be available to JVM targets (or Android)
a
It doesnt seem to be working in commonMain either
Is there not a way to call something like System from commonMain?
j
You can expect/actual it, but what would you expect it to do in JS or native?
a
Good point. I'm loading a native library but I can do that on the native layer. I'm targeting desktop. Would I need to add a desktopMain?
j
It depends on what your list of targets are. If it's just Android and the JVM then you can expect/actual the call (there's no commonization of APIs between the JVM and Android so you have to do it manually).
a
mingwX64("native")
for example. Thats the desktop target right now