首页 > 解决方案 > 是否可以在 macOS 10.12 上使用 Kotlin Native?

问题描述

我正在尝试将一个简单的 Go macOS 应用程序移植到 Kotlin Native。在与各种错误作斗争后,我决定退后一步,看看 Kotlin Native 提供的官方示例。

我在这里找到了一个基本的 OpenGL 示例:

https://github.com/JetBrains/kotlin-native/tree/master/samples/opengl

但到目前为止,我还无法编译它。

我尝试下载 Kotlin 的完整源代码,但无法构建。我遵循了构建时生成的一些建议,包括对“ignoreXcodeVersionCheck”的更改和为编译器下载预构建的二进制文件,但此时我想知道我的环境是否不支持这一点?我明白这都是实验性的。

我在下面附上了一个错误示例,但我不确定什么是相关的。

问题:请问其他人有这个设置/环境吗?我可以期待让它工作吗?

macOS 10.12.4、科特林 1.3.11、xcode 8.2.1

.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cmath:551:28: error: expected a qualified name after 'typename'
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type

.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>

    A problem occurred evaluating root project 'kotlin-native-master'.
 expected Xcode version 10.1, got 8.2.1, consider updating Xcode or use "ignoreXcodeVersionCheck" variable in konan.properties

kotlin-native-master/runtime/src/main/cpp/ObjCExportErrors.mm:73:23: error: no type or protocol named 'NSErrorUserInfoKey'
  NSMutableDictionary<NSErrorUserInfoKey, id>* userInfo = [[NSMutableDictionary new] autorelease];

.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;

标签: openglkotlin-native

解决方案


我确实设法让“hello world”在上述环境下工作,但我已经放弃了 OpenGL 的东西。我目前无法更新我的环境,我想这个问题不会影响很多人。所以我要用这个“答案”来结束它。


推荐阅读