1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Kotlin/NativeでHelloWorld

Last updated at Posted at 2018-11-11

tl;dr

基本的に以下のREADME通り進めばできる
https://github.com/JetBrains/kotlin-native

Kotlin/Nativeを準備

以下からclone
https://github.com/JetBrains/kotlin-native

❯ git clone https://github.com/JetBrains/kotlin-native.git

READMEに書いてあることをそのまま実行するだけ

依存モジュールをダウンロード

結構時間がかかる

./gradlew dependencies:update

コンパイラ・ライブラリビルド

READMEに1時間とあるが、自分のMBPで2時間かかった。。

./gradlew bundle

PATHを通す

❯ export PATH=./dist/bin:$PATH

これで準備完了。

実際に使う

コードを書く

hello.kt
fun main() {
    println("Hello World!")
}

コンパイル

❯ kotlinc hello.kt -o hello -opt

実行

❯ ./hello.kexe
Hello World!

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?