How to import from other packages in kotlin/native

Hi,
I’ve got two files: a.kt and b.kt

package a

fun g(i: Int): String = "${K()}  ${fa(i)}"

and

package b
import a.*

fun main() {
  println(g(1))
}

On Intellij IDE the import works fine, but if I compile the files from the command line using konanc.exe, it won’t work, saying g is unknown.
How do you import packages?
Thank you very much for reading.

1 Like

Make sure the path you specify to compile is your src directory that contains both packages

I put both files in the same folder and ran konanc.exe from there. Also, there isn’t any option to specify your path to source files.

1 Like