is using a C main function a supported use case fo...
# kotlin-native
k
is using a C main function a supported use case for the
-nomain
flag? I've been trying to get something like
konanc -nomain foo.kt -linkerOpts main.o -e main
to work (where main.c is a C hello world) but i'm getting stuck on
function Konan_start: error: undefined reference to 'EntryPointSelector'
, wondering if theres an obvious flag im missing
a
Make sure you have the
fun main(args: Array<String>)
within the default package in your foo.kt. That's what your
-e main
refers to.
k
I'm trying to have the main be provided by C, i.e. main.c is
void foo(void); int main(int argc, char **argv) { foo(); return 0; }
and foo.kt is
fun foo() {}
, and there is no kotlin main function. is this possible with the -nomain flag?