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 How to 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 {
    java
    kotlin("multiplatform") version "1.3.21"
    id("io.kotlintest") version "1.0.2"
}

//Defines which public repos are used to download dependencies
repositories {
    jcenter()
    google()
}

val implementation by configurations
val testImplementation by configurations
val testRuntimeOnly by configurations
dependencies {
    //testCompile("io.kotlintest:kotlintest-core:3.0.2")
    //testCompile("io.kotlintest:kotlintest-assertions:3.0.2")
    //testCompile("io.kotlintest:kotlintest-runner-junit5:3.0.2")
    compile(group = "mysql", name = "mysql-connector-java", version = "5.1.6")
}

kotlin {
    mingwX64("server") {
        binaries {
            executable()
        }
    }
}

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