Kotlin/Native requires that C libraries are compiled with a specific verison of GCC.
You can use the GCC used by Kotlin/Native itself. These Gradle tasks will help with this.
// build.gradle.kts
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile