Re: [personal kdb+] KDB/C interface: query always returns result->t=0

hi,

you may need to #define KXVER before #including k.h

#define KXVER 3
#include"k.h"

http://code.kx.com/mediawiki/index.php?title=Special:KwikiSearch&search=KXVER&go=Go

ta, jack

this comes up now and then… it might be worth kx adding a #error to k.h:

#ifndef KXVER
#error 'KXVER
#endif

yes, it would break older code, but it’s easy to add a #define or a
-D. and older code could well be using older versions of k.h anyway
that wouldn’t have this #error.

just a thought - it would save a lot of frustration for those new to
building c/k interfaces. the build instructions commented in
http://code.kx.com/wsvn/code/contrib/wiki/csv.c don’t mention KXVER:

// compile with gcc -m64 csv.c c.o
// obtain c.o from http://kx.com/q/l64/c.o for linux
// obtain k.h form http://kx.com/q/c/c/k.h

> have a great weekend.

you too!

ta, jack

>
> Best Regards
> YZ
>
>
>
> On Friday, January 18, 2013 7:37:59 PM UTC-5, Jack Andrews wrote:
>>
>> hi,
>>
>> you may need to #define KXVER before #including k.h
>>
>> #define KXVER 3
>> #include"k.h"
>>
>>
>> http://code.kx.com/mediawiki/index.php?title=Special:KwikiSearch&search=KXVER&go=Go
>>
>> ta, jack
>>
>>
>> On Sat, Jan 19, 2013 at 11:09 AM, Yue Zhao <yzha…> wrote:
>> >
>> > Hi, all,
>> >
>> > I am using windows, I set up>
the kdb server by typing
>> >
>> > > q.exe -p 5000
>> >
>> > I believe the server is well established. I can use studio for KDB+ to
>> > connect to this server and get the result without any problem.
>> >
>> > Then I copied the csv.c file from the kx website
>> > (http://code.kx.com/wsvn/code/contrib/wiki/csv.c) and compiled using VS2010.
>> > However, when I step through my code by pressing F10, I can see that after
>> >
>> > result=k(handle,“(a:til 10;b:reverse til 10;c:10?`4)”,(K)0);
>> >
>> > I can see the result is updated, but result->t is set to 0, which is
>> > supposed to be 98 or 99.
>> >
>> > can some one help me with this? I would be really grateful … being
>> > bothered by this issue for a long time.
>> >
>> > Thanks a lot
>> >
>> > –
>> > You received this message because you are subscribed to the Google
>> > Groups “Kdb+ Personal Developers” group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/personal-kdbplus/-/AUTdBlHCHNEJ.
>> > To post to this group, send email to personal...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > personal-kdbpl...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/personal-kdbplus?hl=en.

</yzha…>