I've tried to make a "hello world" static library ...
# kotlin-native
g
I've tried to make a "hello world" static library with KN on Windows I have:
Copy code
@CName("kt_add")
fun add(a: UInt, b: UInt): UInt = a + b
With build config:
Copy code
nativeTarget.apply {
    binaries {
        staticLib {}
    }
}
Trying to call this from a C file, like:
Copy code
#include "../build/bin/native/debugStatic/libfoo_kotlin_native_api.h"
#include "stdio.h"

int main()
{
    int res = kt_add(1, 2);
    printf("%d\n", res);
    return 0;
}
Throws a bunch of errors about what look like missing stdlib symbols 🤔
__cxa_begin_catch
,
std::terminate()
,
__cxa_call_unexpected
, etc What might I be doing wrong? I'm building with:
gcc main.c ..\build\bin\native\debugStatic\libfoo_kotlin_native.a