2013.12.22 07:42 AM
2013.12.22 07:48 AM
So I'm trying to have a c function "start" which launches a java program using a system call:--
Here's what it looks like
#define KXVER 3
#include"k.h"
#include <stdlib.h>
#include <stdio.h>
void start(K something)
{
printf("starting java");
system("java Prog hello there");
}
I compiled this as bar.so, using the command shown on Cookbook/ExtendingwtihC on the wiki, and placed it in my ~/q/ directory along with Prog.class.
(The only thing Prog.class does is print out its arguments).
The compilation was fine, there was no issue with k.h or anything else.
But when I try to call the function within q using
q)start: `bar 2:(`start;1)
I get an error saying:
'bar.so: cannot open shared object file: No such file or directory
I've tried putting the .so and .class files pretty much everywhere, inside l32, in the home directory, etc. but I still get this error.
Ive set my QHOME variable to /q/, and echoing $QHOME shows that.
I have no idea what to do next, and I really need this to work, so any help will be greatly appreciated.
Thanks
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/groups/opt_out.
2013.12.22 08:01 AM
2013.12.22 12:36 PM
echo $LD_LIBRARY_PATH
produces nothing, so it's empty right?
How would I add the location? Do I just export ~/q/ to the name of the variable?
2013.12.22 12:48 PM
2013.12.23 03:25 AM
2013.12.23 07:55 AM
it looks like you compiled your shared library to be 64bit.If you are loading it into 32bit kdb+, you should compile with -m32 flag to gcc.btw, your c function should return either null or a ptr to a valid kobject.e.g.
K start(K something)
{
printf("starting java");
system("java Prog hello there");
return 0;
}
2013.12.23 08:03 AM
2013.12.23 08:12 AM
2013.12.23 08:22 AM
2013.12.23 08:24 AM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.