I have created a c++ .so file to pass data to q which compiles only with warnings, and can be loaded into q. I have tested the c++ code runs as a program returning a kdb object without crashing(a dictionary). However when I load it in q and try to run it I get
getkdbobj:($"/home/Models/Code/makeKDBObj") 2:(
$“_ZN10makeKDBObj7getkobjEi”;1)
q)getkdbobj[1]
k){$[(::)~x;“”;`/:$[10h=@r:@[S[(.“\c”)-2 1;0j];x;::];,-3!x;r]]}
'nyi
x
*** Break *** segmentation violation
The c++ code is
makeKDBObj.cpp
#include “makeKDBObj.hpp”
#include “k.h”
extern “C” makeKDBObj* create_object()
{
return new makeKDBObj;
}
extern “C” void destroy_object(makeKDBObj* object )
{
delete object;
}
using namespace std;
makeKDBObj::makeKDBObj()
{
int x=20;
}
K makeKDBObj::getkobj(int x)
{ code
}
The header file is
makeKDBObj.hpp
#include various files
#include “k.h”
class makeKDBObj
{
public:
makeKDBObj();
virtual K getkobj(int x);
};
when i do nm -D makeKDBObj.so |grep getkobj, I get
0000000000004a40 T _ZN10makeKDBObj7getkobjEv
(I dont get getkobj as a symbol in the .so file?)
Thanks- any help would be appreciated