Hi. When I try to build binaries for Linux on MacO...
# multiplatform
g
Hi. When I try to build binaries for Linux on MacOS I get error
ld.lld: error: unable to find library -lcurl
It is a small project that uses ktor client and curl
implementation("io.ktor:ktor-client-curl")
Here is the build file for root project
Copy code
plugins {
    kotlin("multiplatform") version "1.9.21"
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

kotlin {
    jvmToolchain(17)
    macosX64()
    linuxX64()
    mingwX64()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(project.dependencies.platform("io.ktor:ktor-bom:2.3.7"))
                implementation("io.ktor:ktor-client-auth")
                implementation("io.ktor:ktor-client-encoding")
                implementation("io.ktor:ktor-client-curl")
                implementation("io.ktor:ktor-client-logging")
                implementation("io.ktor:ktor-client-content-negotiation")
                implementation("io.ktor:ktor-serialization-kotlinx-json")
                implementation("com.squareup.okio:okio:3.7.0")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
                implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.3.0")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
            }
        }
    }
}
Here is the one for another module that includes rootProject
Copy code
plugins {
    kotlin("multiplatform") version "1.9.21"
//    id("org.jetbrains.kotlin.jvm")
//    id("com.jakewharton.mosaic") version "0.10.0"
}

version = "1.0"

repositories {
    mavenCentral()
}

kotlin {
    jvmToolchain(17)
    macosX64 {
        binaries {
            executable {
                baseName = "mpp-macosX64"
                entryPoint = "hidden"
            }
        }
    }

    linuxX64 {
        binaries {
            executable {
                baseName = "mpp-linuxX64"
                entryPoint = "hidden"
            }
        }
    }

    mingwX64 {
        binaries {
            executable {
                baseName = "mpp-mingwX64.exe"
                entryPoint = "hidden"
            }
        }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(rootProject)
                implementation("com.github.ajalt.clikt:clikt:4.2.1")
            }
        }
    }
}

tasks.withType<Wrapper> {
    gradleVersion = "8.1.1"
    distributionType = Wrapper.DistributionType.BIN
}
When I run
linuxX64Binaries
this is the output
Copy code
16:03:42: Executing 'linuxX64Binaries'...

> Task :checkKotlinGradlePluginConfigurationErrors
> Task :compileKotlinLinuxX64 UP-TO-DATE
> Task :linuxX64Binaries UP-TO-DATE
> Task :cli:checkKotlinGradlePluginConfigurationErrors
> Task :cli:compileKotlinLinuxX64 UP-TO-DATE
> Task :xcodeVersion UP-TO-DATE
> Task :cli:linkDebugExecutableLinuxX64
e: /Users/shalva/.konan/dependencies/apple-llvm-20200714-macos-x64-essentials/bin/ld.lld invocation reported errors

The /Users/shalva/.konan/dependencies/apple-llvm-20200714-macos-x64-essentials/bin/ld.lld command returned non-zero exit code: 1.
output:
ld.lld: error: unable to find library -lcurl

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cli:linkDebugExecutableLinuxX64'.
> Compilation finished with errors

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.

BUILD FAILED in 32s

> Task :cli:linkDebugExecutableLinuxX64 FAILED
6 actionable tasks: 3 executed, 3 up-to-date
16:04:15: Execution finished 'linuxX64Binaries'.
c
Hey, you need to install the
curl
or
libcurl
package on your system.