如何使用 C API 将字符串连接到 kdb 中的混合列表

How to join strings to a mixed list in kdb using C API

I am going through the InterfacingWithC cookbook from Kx, and trying to create a mixed list of two symbols, then append a symbol to it. This keeps crashing my kdb process when I load it in a shared object. So this simple code crashes

K msgs =  knk(2, ktn(KS, 0), ktn(KS, 0));
K syms=kK(msgs)[0];
S sym=ss("IBM");
js(&syms, sym); <-- this line seg faults

But this code not using a list works just fine

K syms=ktn(KS,0);
S sym=ss("IBM");
js(&syms,sym);

The way I understand it is that knk gives me a mixed list, and I can access elements of that list using kk function.我在这里错过了什么?

找到答案了。当我的 kdb version/libs/includes 是版本 2 时,我使用的是 KXVER 版本 3。我将其更改为两个,现在它工作正常。以防对某人有帮助。