crash when running a c++ dll to pass data as dictionary to q

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

On further analysis , there was an error in the kdbobj being created.

I have now corrected this, and we still get the same error.

However now when I view the object
0 1 2 3 4 5 6 7 8!(47054528968112 47054529042384 47054528970304 4705452906977

count each x

0 1 2 3 4 5 6 7 8!3414 3414 3414 3414 3414 3414 3414 3414 3414

3#'x

0 1 2 3 4 5 6 7 8!(47054528968112 47054529042384 47054528970304j;47054528970304 47054529069776 47054528969952j;47054528969952 47054528903360 47054528968112j;47054528969872 47054529098752 47054528969872j;47054529098768 47054529098768 47054529098768j;47054529098752 47054528969872 47054529098752j;-1132791616 -1132726864 -1132652592;-1132625200 -1132725024 -1132791616;-1132652592 -1132724672 -1132625200)

So this looks like a vlid dictionary.

Why is it crashing?

>compiles only with warnings

Maybe the warnings are relevant? Better fix those first?