Kotlin Native Unresolved Reference

I can’t seem to figure out how to avoid unresolved references, I’m trying to make build.gradle.kts add the dependency for mysql connector, to be used in a project with a linux server kotlin native app, js/ios/android client (native kotlin if possible though not sure if its possible). I’m following this tutorial https://www.tutorialkart.com/kotlin/connect-to-mysql-database-from-kotlin-using-jdbc/, but anytime I try to import anything at the top of my hello world code I see red everywhere, really could use a hand, what am I missing? I’m starting to think the real problem here is Kotlin Native, but there is a lot new to me here… if kotlin native is the problem, what are my other options for this project? I’m compiling for windows ATM for simplicity, I really dislike JVM… but if that’s the best option to code in Kotlin for a linux server than I guess I need to use that instead, how would I convert this? Really confused.

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("multiplatform") version "1.3.21"
    id("io.kotlintest") version "1.0.2"

//Defines which public repos are used to download dependencies
repositories {

val implementation by configurations
val testImplementation by configurations
val testRuntimeOnly by configurations
dependencies {
    compile(group = "mysql", name = "mysql-connector-java", version = "5.1.6")

kotlin {
    mingwX64("server") {
        binaries {

tasks.withType<Wrapper> {
    gradleVersion = "5.3.1"
    distributionType = Wrapper.DistributionType.ALL

You cannot use Java code/libraries in a Native target.

Good to know!

Lol, thank you. That wasn’t at all obvious, I thought Kotlin was built on Java, so I would’ve expected Kotlin to be able to convert java packages to native packages… otherwise I should be using C++ and C++ packages. So basically Kotlin Native has no real libraries? Like a basic mysql connector, is such a thing possible with Gradle and Kotlin native?

Hello, @gunslingor. When you are working with Kotlin/Native, you can use C libraries, as it is described on the compiler’s GitHub page. Some basic libraries are provided by default, named as Platform libraries. Other ones got to be wrapped by cinterop tool.
I personally recommend you to go through tutorials on the kotlinlang.org, they can help you to become more familiar with the language and it’s usage.

you can use sqlite.def