Call dll generate from kotlin native in kotlin native



first sorry if i this question in wrong place and i’m beginner in kotlin.

last night i try tutorial from and it work perfectly. but then i try to call *.dll file from kotlin native it self but always get error or wrong output. can anyone tell me how to call method or property in that *dll file or point me where to find the answer ?

thank you.

here is my project directory layout :


here is my code that call method or property in .dll file :
import kotlinx.cinterop.

import platform.posix.*
import libnative_symbols.*

these is command i call to compile source :
cinterop -def libnative_symbols.def -compilerOpts -I./ -o libnative_symbols
kotlinc-native ..\kotlin -l libnative_symbols -linker-options libnative.lib -o usedll
fun main (args : Array<String>) {
	val lib : CPointer<libnative_ExportedSymbols>? = libnative_symbols()
	// val ref = libnative_ExportedSymbols(lib.rawValue);

	var str : String? = "This is how to use dll from kotlin native"
	var resp : CPointer<ByteVar>? = lib!!.pointed.kotlin.root.example.get_globalString!!.reinterpret()

	var path : CPointer<ByteVar>? = getenv("PATH")
	var pathStr : String = path?.toKString() ?: ""

	println("input : " + str)
	println("output : " + resp!!.toKString())
	println("path : " + pathStr)