Patrick
05/15/2020, 10:38 AM> Task :windows-framework:linkDebugSharedWindows
Produced library API in nimmstaWindows_api.h
e: Compilation failed: The C:\Users\Patrick\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++ command returned non-zero exit code: 1.
output:
C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:355:9: error: unknown type name 'nimmstaWindows_kref_com_soywiz_klock_DateTime'; did you mean 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile'?
nimmstaWindows_kref_com_soywiz_klock_DateTime (*get_dateCreated)(nimmstaWindows_kref_WinNimBuildInfo thiz);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nimmstaWindows_kref_com_soywiz_korio_file_VfsFile
C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:242:3: note: 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile' declared here
} nimmstaWindows_kref_com_soywiz_korio_file_VfsFile;
^
C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:1061:8: error: unknown type name 'nimmstaWindows_kref_com_soywiz_klock_DateTime'; did you mean 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile'?
static nimmstaWindows_kref_com_soywiz_klock_DateTime _konan_function_9_impl(nimmstaWindows_kref_WinNimBuildInfo arg0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nimmstaWindows_kref_com_soywiz_korio_file_VfsFile
C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:242:3: note: 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile' declared here
} nimmstaWindows_kref_com_soywiz_korio_file_VfsFile;
^
C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:1067:12: error: unknown type name 'nimmstaWindows_kref_com_soywiz_klock_DateTime'; did you mean 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile'?
return ((nimmstaWindows_kref_com_soywiz_klock_DateTime){ .pinned = CreateStablePointer(result)});
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nimmstaWindows_kref_com_soywiz_korio_file_VfsFile
C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:242:3: note: 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile' declared here
} nimmstaWindows_kref_com_soywiz_korio_file_VfsFile;
^
3 errors generated.
Any ideas what I need to change? Those are all library classes.Artyom Degtyarev [JB]
05/15/2020, 12:09 PMPatrick
05/15/2020, 1:05 PMPatrick
05/15/2020, 1:05 PMArtyom Degtyarev [JB]
05/15/2020, 2:08 PMlinkDebugSharedWindows
or into the compileKotlinWindows?
Patrick
05/15/2020, 2:09 PMPatrick
05/15/2020, 2:10 PMpackage sample
import com.soywiz.klock.DateTime
import kotlin.native.concurrent.ThreadLocal
fun main() {
}
@ThreadLocal
object WinNimBuildInfo {
val dateCreated: DateTime? = null
}
This is the code I can reduce it to that will throw the errorPatrick
05/15/2020, 2:11 PMplugins {
kotlin("multiplatform") version ("1.3.72")
kotlin("plugin.serialization") version "1.3.72"
}
repositories {
mavenCentral()
jcenter()
}
kotlin {
val ktorVersion = "1.3.2"
val korioVersion = "1.10.0"
val serializationVersion = "0.20.0"
val logbackVersion = "1.2.3"
val klockVersion = "1.9.1"
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
mingwX64("mingw") {
binaries {
executable {
entryPoint("sample.main")
}
sharedLib {
baseName = "reproducer"
}
}
}
sourceSets {
commonMain {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("com.soywiz.korlibs.korio:korio:$korioVersion")
implementation("com.soywiz.korlibs.klock:klock:$klockVersion")
}
}
commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
mingwX64().compilations["main"].defaultSourceSet {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serializationVersion")
}
}
mingwX64().compilations["test"].defaultSourceSet {
}
}
}
Patrick
05/15/2020, 2:12 PMPatrick
05/15/2020, 2:24 PMval dateCreated: DateTime? = null
with val dateCreated: DateTime = DateTime(12313123)
it worksPatrick
05/15/2020, 2:26 PMval dateCreated: Int? = null
it also worksArtyom Degtyarev [JB]
05/15/2020, 3:08 PMPatrick
05/18/2020, 8:05 AMArtyom Degtyarev [JB]
05/18/2020, 9:17 AMPatrick
05/18/2020, 9:18 AMArtyom Degtyarev [JB]
05/18/2020, 5:38 PMPatrick
05/19/2020, 1:27 PM