[C API] krr/orr doesn't report error

I’m working on a pet project on Windows (MSVC 2019 Community) that intend to create a DLL that is to be invoked from q.exe.

I found that krr/orr didn’t seem to work as advertised in the documentations.

Sample code:


/// testdll.cpp

#define KXVER 3

#include <k.h>

char *msg{ “Test error!” };

extern “C” __declspec(dllexport) K test(K) { return krr(msg); }


/// test.q

test:testdll 2:(test;1)

test / does not report error as expected


According the documentation, krr is supposed to report error in q, but it didn’t. May I know if there is anything with my understanding about krr/orr?

the code look ok. 
build it with debug symbols and run it in the debugger.

I had a similar issue on Linux. The problem was that I was linking with c.o even though I was building a shared library. Removing the linkage fixed the issue for me. Not sure if it’s similar on Windows.