I'm trying to build native binaries for Linux with a Kotlin Multi-Platform project that has Ktor dependency. However when I run the task nativeBinaries I'm getting the following error:
e: /Users/<user>/.konan/dependencies/clang-llvm-apple-8.0.0-darwin-macos/bin/ld.lld invocation reported errors
The /Users/<user>/.konan/dependencies/clang-llvm-apple-8.0.0-darwin-macos/bin/ld.lld command returned non-zero exit code: 1.
output:
ld.lld: error: unable to find library -lcurl
The project is a simple one with the following dependencies
val commonMain by getting {
dependencies {
implementation("io.ktor:ktor-client-core:1.5.4")
}
}
val nativeMain by getting {
dependencies {
implementation ("io.ktor:ktor-client-curl:1.5.4")
}
}
It builds successfully if I remove ktor client curl dependency from nativeMain.
I have curl installed on my local environment (I'm using mac), Am I missing something? Do I need to do any other configurations to get rid of this error?