Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.
This repository was archived by the owner on May 17, 2023. It is now read-only.

Unresolved reference: main #135

Open
@shalva97

Description

@shalva97

hello, decided to do some kotlin native and found this hands-on/Introduction to Kotlin Native/04_AddingInteropToBuild.md

there it says to add some newlines to generate some header files. but I get errors:

e: /home/shalva/intellijProjects/IdeaProjects/untitled/build.gradle.kts:26:22: Unresolved reference: main
e: /home/shalva/intellijProjects/IdeaProjects/untitled/build.gradle.kts:27:13: Unresolved reference: cinterops
e: /home/shalva/intellijProjects/IdeaProjects/untitled/build.gradle.kts:28:17: Unresolved reference: libcurl

Build file '/home/shalva/intellijProjects/IdeaProjects/untitled/build.gradle.kts' line: 26

Script compilation 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.

my build file is auto generated from intellij:

plugins {
    kotlin("multiplatform") version "1.5.0-RC"
}

group = "me.shalva.firsplugin"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}



kotlin {
    val hostOs = System.getProperty("os.name")
    val isMingwX64 = hostOs.startsWith("Windows")
    val nativeTarget = when {
        hostOs == "Mac OS X" -> macosX64("native")
        hostOs == "Linux" -> linuxX64("native")
        isMingwX64 -> mingwX64("native")
        else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
    }

    nativeTarget.apply {

        compilations.main { // NL
            cinterops {     // NL
                libcurl     // NL
            }               // NL
        }

        binaries {
            executable {
                entryPoint = "main"
            }
        }
    }
    sourceSets {
        val nativeMain by getting
        val nativeTest by getting
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions