Kotlin/Native 带有平台库的框架
Kotlin/Native framework with platform libs
我有一个 Kotlin/Native 项目,它编译成一个 iOS 框架和一个 Android 库。
我想在项目的单元测试中使用 platform.posix.
中的 POSIX,但编译器找不到 platform
包。
我试过这样导入它:import platform.posix.*
我已经从 kotlin-native 存储库中查看了这个 README.md:https://github.com/JetBrains/kotlin-native/blob/master/PLATFORM_LIBS.md
它说:
The packages from platform libraries are available by default. No
special link flags need to be specified to use them. Kotlin/Native
compiler automatically detects which of the platform libraries have
been accessed and automatically links the needed libraries.
我有点困惑 - 我缺少什么让编译器发现平台库?
在 JVM 上 Android platform.posix
不可用,它是纯粹的 Kotlin/Native 功能。
我有一个 Kotlin/Native 项目,它编译成一个 iOS 框架和一个 Android 库。
我想在项目的单元测试中使用 platform.posix.
中的 POSIX,但编译器找不到 platform
包。
我试过这样导入它:import platform.posix.*
我已经从 kotlin-native 存储库中查看了这个 README.md:https://github.com/JetBrains/kotlin-native/blob/master/PLATFORM_LIBS.md
它说:
The packages from platform libraries are available by default. No special link flags need to be specified to use them. Kotlin/Native compiler automatically detects which of the platform libraries have been accessed and automatically links the needed libraries.
我有点困惑 - 我缺少什么让编译器发现平台库?
在 JVM 上 Android platform.posix
不可用,它是纯粹的 Kotlin/Native 功能。