Search Results

Search found 2 results on 1 pages for 'openbas'.

Page 1/1 | 1 

  • module compiled with swig not found by python

    - by openbas
    Hello, I've a problem with SWIG and python. I've a c-class that compiles correctly, but the python script says it can't find the module. I compile with: swig -c++ -python codes/codes.i g++ -c -Wall -O4 -fPIC -pedantic codes/*.cc g++ -I/usr/include/python2.6 -shared codes/codes_wrap.cxx *.o -o _codes.so This gives me a _codes.so file, as I would expect, but then I have this python file: import sys import codes (rest of the code omitted) It gives me: Traceback (most recent call last): File "script.py", line 3, in <module> import codes ImportError: No module named codes According to http://www.swig.org/Doc1.3/Introduction.html#Introduction_nn8 this is all I should have to do... The files are in the same directory, so the path should not be a problem ?

    Read the article

  • Object does not exist after constructor?

    - by openbas
    Hello, I have a constructor that looks like this (in c++): Interpreter::Interpreter() { tempDat == new DataObject(); tempDat->clear(); } the constructor of dataObject does absolutely nothing, and clear does this: bool DataObject::clear() { //clear the object if (current_max_id > 0) { indexTypeLookup.clear(); intData.clear(); doubleData.clear(); current_max_id = 0; } } Those members are defined as follows: std::map<int, int> indexTypeLookup; std::map<int, int> intData; std::map<int, double> doubleData; Now the strange thing is that I'm getting a segfault on tempDat-clear(); gdb says tempDat is null. How is that possible? The constructor of tempDat cannot fail, it looks like this: DataObject::DataObject() : current_max_id(0) { } I know there are probably better way's of making such a data structure, but I really like to know where this segfault problem is coming from..

    Read the article

1