Issue with Ktor on windows

New user of kotlin multi-platform and I am trying to get a simple poc created that will call an api on both windows and mac.

Following the https://github.com/ktorio/ktor-samples/tree/master/mpp/client-mpp example I have got the code to look ok in the IDE in terms of dependencies.

common references

implementation(kotlin("stdlib-common"))
implementation("io.ktor:ktor-client-core:1.1.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3")
            

and the native windows clients references

implementation("io.ktor:ktor-client-core-native:1.3.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.3")
implementation("io.ktor:ktor-client-curl:1.3.0")

When I come to run it I get the following issue:

C:\Users\pjsmith\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1\bin\ld: cannot find -lcurl
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
e: C:\Users\pjsmith\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++ invocation reported errors

I must need to provide curl somehow to the project, but reading around it was not obvious on how to do this using the local msys2 that is pulled down by the IDE.

Thanks in advance :wink:

If I’m reading the documentation here correctly you need to have curl installed (version 7.63 or later) in addition to adding the dependency to your build file. If this isn’t the problem you should consider opening an issue on their github. You probably get more help there than here. I’m not sure how many of the ktor developers frequent this forum.

Hi, @smitp33! Maybe this can help you a bit.

Link is dead, moved to https://github.com/JetBrains/kotlin/blob/master/kotlin-native/samples/libcurl/README.md

But I guess a more relevant link now would be the Ktor doc itself:
https://ktor.io/docs/faq.html#native-curl