I am trying to call Nim code from C++. Specifically, a function that takes an anonymous function.
I have the following code in Nim:
proc test*(a: proc()) {.exportc.} = a()
which I compile to a static library. I then link it to my C++ executable and attempt to define the function with
extern "C" test(void a(void);
and call it with
void anon() { printf("hello"); }
...
test(anon)
Everything compiles fine, but when I run the program, it crashes.