Hi. How do you add UIKit to the CLion "classpath" ...
# kotlin-native
s
Hi. How do you add UIKit to the CLion "classpath" ?
o
it's called platform libs
s
@olonho That's the thing : When I create a new CLion Kotlin / Native project,
platform.UIKit
is not available.
o
hmm, you mean it's highlighted red, or it doesn't compile?
s
Both
o
and you use
-target iphone
, right?
s
I Build with CMake
cmake_minimum_required(VERSION 3.8) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/KotlinCMakeModule) project(uikit Kotlin) konanc_executable( NAME HelloWorld SOURCES hello.kt )
o
not sure if cross-compilation is available from CMake, try to build with Gradle
s
Even worse : error: unresolved reference: platform
(in command line, Ill try with gradle)
@olonho Same error with Gradle : unresolved reference: platform
o
Did you run ./gradlew bundle
It builds platform libs, but it takes time
s
I think so, maybe I forgot, let's try 😉
a
With CMake use TARGET iphone in konanc_executable invocation.
s
OK, so it does compile now using Gradle \o/
Hale-fracking-luya ! It took me the entire day 😉 But it all works 😄