Any idea why the compiler might be failing with me...
# kotlin-native
t
Any idea why the compiler might be failing with messages like these? I'm running v0.3.4 (with Gradle) under Wine. It used to work, with v0.3 I think.
Copy code
...
C:\users\konan\.konan\kotlin-native-windows-0.3.4\dependencies\msys2-mingw-w64-x86_64-gcc-6.3.0-clang-llvm-3.9.1-windows-x86-64\bin\ld: Dwarf Error: mangled line number section (bad file number).
C:\users\konan\.konan\kotlin-native-windows-0.3.4\dependencies\msys2-mingw-w64-x86_64-gcc-6.3.0-clang-llvm-3.9.1-windows-x86-64\bin\ld: Dwarf Error: Offset (1562511360) greater than or equal to .debug_str size (262582).
...
o
looks like some Wine issue, hard to tell from this message
t
It turns out it was due to the linker not being happy with the interop definitions I had copied from the generated files earlier (to be able to pass numeric constants for a LPWSTR parameter). What would be the best way to do that now that we have the platforms klibs? E.g., some win32 functions that take a LPWSTR parameter cleverly allow you to pass either a pointer to a char array (i.e., a string) OR one of several predefined integer constant values; but cinterop treats it as a String parameter, so there is no way to pass the constants. So I'd like to add an overloaded version that takes a LONG value instead (or ideally, in this particular case, a Short).
m
Maybe autoconverting from String should be disabled for this funtion in windows.def, in
noStringConversion
. Have you full list of problematic functions?
t
Aha, thanks, I didn't know about noStringConversion. The affected functions would be the ones that are used in conjunction with MAKEINTRESOURCE, I think. LoadIcon and LoadCursor are the ones I ran into. However, reading my Petzold (I'm pretty new to win32), it seems you can actually pass the constants as strings! So it's actually fine in this case. 🙂