&gt; error: invalid argument: -linkerArgs here <ht...
# kotlin-native
e
m
-linker-options
e
yeah, it looks working
how can I type
UByte
?
Copy code
src/HelloSfml.kt:67:50: error: type mismatch: inferred type is Int but sfUint8 /* = UByte */ was expected
d
You have to explicitly use
toUByte()
. There's no literal available yet.
e
I dont have that
is it possible that the guy is using a pre 1.3 kt lib?
there is no gradle.. how can I check the kt version?
d
They were using pre-0.9, which is indeed pre 1.3.
e
how can I upgrade? how did you see pre 0.9?
is it the
lib/Runtime.jar
, isnt?
d
They just used whatever version available. Which at the time of developing was at least before 0.9, from the looks of it.
What do you mean by 'upgrade'?
e
I mean, I want to use of course 1.3
I guess I shall replace
lib/Runtime.jar
I found one under
/home/elect/CLionProjects/kotlin-native/dist/konan/lib
.. is it right?
d
Oh, since Native is not stable between versions, you'll have to rewrite the project.
I'm not sure about replacing that jar.
e
yeah, just tried, didnt work
what you mean by rewrite?
d
You'll have to edit the source files of the project to fix the breaking changes.
d
For example, cinterop now generates methods with unsigned integers instead of signed for some methods.
e
I'm already modifying the
HelloSfml.kt
d
Yes, the file you are modifying.
e
videoMode.width = 800
was fixed with
videoMode.width = 800u
but I dont have any
toUByte()
or at least it doesnt suggest it, let me try to hardcode
d
Oh. Try,
toUInt().toUByte()
.
e
oh yead
d
Some conversions aren't directly supported yet. (for some reason idk).
e
it works, CLion doesnt show it as available on alt-ctrl, but if I hardcode it and
./build.sh
the error disappears
d
Oh, okay.
e
but with crappy IDE supports will be a nightmare writing complex projects..
I wonder if Idea is better.. @msink do you have feedbacks in regards?
d
IDEA is better for code completion (until recently) but CLion is the only IDE that has any debugging.
e
is it possible/feasible to work with both on the same project? Wont they interfere with each other?
also fuck, I was full of joy because I finally built the
.kexe
, but:
Copy code
Uncaught exception from Kotlin's main: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.Array@d54728
        at  (0x246545)
        at kfun:kotlin.collections.ArrayList.insertAtInternal#internal (0x226900)
        at kfun:kotlin.collections.ArrayList.addAtInternal#internal (0x226479)
        at kfun:kotlin.collections.ArrayList.add(#GENERIC)ValueType (0x22624b)
        at kfun:main(kotlin.Array<kotlin.String>) (0x218fe5)
        at Konan_start (0x2169d7)
        at Konan_run_start (0x216953)
        at Konan_main (0x2168c7)
        at __libc_start_main (0x7fab6433809b)
        at  (0x216029)
        at  ((nil))
AL lib: (EE) alc_cleanup: 1 device not closed
is this debuggable from CLion?
d
That's probably one of the breaking changes.
Do you have more than one thread running?
e
I guess no, but I wouldnt swear..
and there is no line number, that's deadly..
d
I know right. 😂
e
how can I debug from within Lion?
I need to manually fill in a new configuration, do I?
d
You will have to annotate those `object`s with
ThreadLocal
.
e
line 59?
which objects?
ok
d
Sprites
and
Textures
.
e
omg it worked
you super meister
😁 1
d
By default, singletons are frozen.
e
message has been deleted
@Dominaezzz any idea how to fix in Idea this?
apparently marking it as src did the trick.. sorry