One of the methods I'm trying to call receives a p...
# kotlin-native
n
One of the methods I'm trying to call receives a parameter of type
DWORD
- how can I construct this?
o
pass
<http://kotlin.Int|kotlin.Int>
n
Now I am getting this error:
Copy code
C:\Users\N\AppData\Local\Temp\konan_temp2440511256202047371\combined.o:(.text+0x231af): undefined reference to `__imp_SetupDiGetClassDevsA' 
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
error: c:\Users\N\.konan\dependencies\msys2-mingw-w64-x86_64-gcc-7.2.0-clang-llvm-5.0.0-windows-x86-64/bin/clang++ invocation reported errors
I've adjusted my
ddk.def
to include
Setupapi.h
in the headers, and this is my new code:
Copy code
import ddk.*
import platform.posix.GUID
import kotlinx.cinterop.*

fun main(args: Array<String>): Unit = memScoped {
	val guid = alloc<GUID>()
	HidD_GetHidGuid(guid.ptr)
	SetupDiGetClassDevsA(guid.ptr, null, null, 2)
}
m
Add -lsetupapi into linkerOpts
👍🏻 1