For one of my projects, I'm trying to compile with...
# kotlin-native
l
For one of my projects, I'm trying to compile without stdlib. I created a file (test.kt) with the following code
Copy code
fun main() {
	
}
and tried compiling it with
konanc -nostdlib test.kt
. I get the following errors:
error: could not load module <org.jetbrains.kotlinx.kotlinx-cli>
error: compilation failed: Kotlin IR Linker exception
Has anyone tried compiling with the nostdlib option?
I had some more complex code when I first ran into this, but an empty main seems to replicate the problem.
n
KotlinX CLI is a separate Kotlin library ( https://github.com/Kotlin/kotlinx-cli ).
l
I figured it was. I wonder why it is trying to load it in my empty main program.
I noticed on that link that cli is an endorsed library. Passing the -no-endorsed-libs flag seems to have gotten me past that error.
n
With Kotlin Native programs KotlinX CLI is one of the bundled libraries, even though the library itself is standalone. I am not sure if that is still the case with more recent Kotlin versions.