view · edit · history · print

Kotlin, coding for Android and othe platforms on JVM or native

editor/IDE

Ref

Native from command line

Downloading https://services.gradle.org/distributions/gradle-5.1-all.zip
...............................................
Starting a Gradle Daemon (subsequent builds will be faster)
<-------------> 0% INITIALIZING [52s]
> Building buildSrc > :buildSrc > Resolve files of :buildSrc:classpath > kotlin-gradle-plugin-model-1.3.50-dev-44.jar
...
Extracting dependency: C:\Users\USERNAME\.konan\
!! stuff also installed in C:\Users\USERNAME\.gradle\
...
BUILD SUCCESSFUL in 17m 12s
7 actionable tasks: 7 executed
FAILURE: Build failed with an exception.
  • C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat dist
C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat dist
> Configure project :klib
feature GRADLE_METADATA is not enabled: publication is disabled
...
> Task :backend.native:genHashInteropStubs FAILED
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\wim.vanhooste\.konan\dependencies\msys2-mingw-w64-x86_64-gcc-7.3.0-clang-llvm-lld-6.0.1\bin\libclang.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
        at java.lang.Runtime.load0(Runtime.java:809)
        at java.lang.System.load(System.java:1086)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.prepareTool(main.kt:297)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:176)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib$default(main.kt:161)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.main(main.kt:33)
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':backend.native:genHashInteropStubs'.
> Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_211\bin\java.exe'' finished with non-zero exit value 1
...
BUILD FAILED in 4m 1s
50 actionable tasks: 50 executed
  • It seems the build due to my 32bit java and it tries to compile 64bit
  • C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat cross_dist
> Configure project :klib
feature GRADLE_METADATA is not enabled: publication is disabled
...
BUILD FAILED in 1m 30s
23 actionable tasks: 1 executed, 22 up-to-date
  • C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat dist clean
  • C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat clean
...
BUILD SUCCESSFUL in 1m 46s
15 actionable tasks: 13 executed, 2 up-to-date
  • C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat Wasm32
Task 'Wasm32' is ambiguous in root project 'kotlin-native-master-compile-toolchain'. Candidates are: 'wasm32CrossDist', 'wasm32CrossDistRuntime', 'wasm32Debug', 'wasm32Dependencies', 'wasm32Hash', 'wasm32Install', 'wasm32Launcher', 'wasm32PlatformLibs', 'wasm32Release', 'wasm32Runtime', 'wasm32Stdlib'.
  • C:\_mydata\Development\kotlin-native-master-compile-toolchain>gradlew.bat wasm32CrossDist
Task 'Wasm32' is ambiguous in root project 'kotlin-native-master-compile-toolchain'. Candidates are: 'wasm32CrossDist', 'wasm32CrossDistRuntime', 'wasm32Debug', 'wasm32Dependencies', 'wasm32Hash', 'wasm32Install', 'wasm32Launcher', 'wasm32PlatformLibs', 'wasm32Release', 'wasm32Runtime', 'wasm32Stdlib'.
C:\_mydata\Development\Kotlin_test1>java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
  • create 01hello.kt, compile & run
C:\_mydata\Development\Kotlin_test1>type 01hello.kt
fun main(args: Array<String>) {
println("Hello world")
}
C:\_mydata\Development\Kotlin_test1>C:\_myapps\kotlinc.bak\kotlin-native-windows-1.3.31\bin\kotlinc-native.bat 01hello.kt -o 01hello.exe
C:\_mydata\Development\Kotlin_test1>01hello.exe
Hello world

FINALLY!









admin · attr · attach · edit · history · print
Page last modified on May 20, 2019, at 11:26 AM