Hello I try to use wlanapi for mingw 1. Make wlan...
# kotlin-native
a
Hello I try to use wlanapi for mingw 1. Make wlanapi.def
Copy code
package = wlanapi
headers = wlanapi.h
headerFilter = wlanapi.h
2. Add to gradle build file
Copy code
mingwX64("mingw") {
        compilations["main"].cinterops.create("wlanapi")
    }
On gradlew I have error:
Copy code
> Task :sdk:cinteropWlanapiMingw
Exception in thread "main" java.lang.Error: C:\Users\alxt\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1\x86_64-w64-mingw32\include\ntddndis.h:99:11: error: unknown type name 'ULONG
        at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
        at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1003)
        at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:992)
        at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:91)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:230)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:46)
        at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:44)
        at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
        at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:37)
Copy code
gradlew --version                                                                                                                                                               
------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------

Build time:   2020-06-30 06:32:47 UTC
Revision:     66bc713f7169626a7f0134bf452abde51550ea0a

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.7 (<http://Amazon.com|Amazon.com> Inc. 11.0.7+10-LTS)
OS:           Windows 10 10.0 amd64
kotlin: 1*.3.72* What can I do to fix it?
a
Hello. You can try adding
depends = windows
at the beginning of the .def file.
a
The error still the same.
I've fixed it. I've added into
ntddndis.h
lines
Copy code
#include <minwindef.h>                                                                                                                                                                                             #include <minwinbase.h>
@Artyom Degtyarev [JB] It's ok? Shall I create bug or pull request?
a
Yes, can you please create an issue on YT?
a
https://youtrack.jetbrains.com/issue/KT-39993 If you tell me where the file is, I will make a pull request.
m
So instead of modyfying msys2 sources you can modify your .def:
Copy code
package = wlanapi
headers = minwindef.h minwinbase.h wlanapi.h
headerFilter = wlanapi.h
👍 1
a
How can I mention you on YT, @msink? I want to copy this snippet to extend its discoverability.