So I was trying to upgrade to python 2.6.1 (from 2.5.2), and pycxx 5.5.0 (from 5.4.2) but ive run into some unresolved external symbals that were not there before...

"public: virtual class Py::Object __thiscall Py::PythonExtensionBase::getattro(class Py::Object const &)"
"public: virtual int __thiscall Py::PythonExtensionBase::setattro(class Py::Object const &,class Py::Object const &)"

Compiling the "simple" demo for 5.5.0 does not create this error (having created a vs project for it, the download seems to be missing it), but looking at the code I cant see how mine differs and thus seems to suddenly decided it needs those two methods...


Since vs aborts after an object file causes these errors Im not sure if all of them will fail, however having commented some classes out etc at least 4 of them do (and always been the first it tried to link)

one of the smaller classes causing the problem:

class PyPrimitive : public Py::PythonExtension<PyPrimitive>
{
public:
    static void InitType();
    PyPrimitive();
    virtual ~PyPrimitive();
   
    Py::Object CreateCircleVB(const Py::Tuple &args);

    Py::Object DrawLine(const Py::Tuple &args);
};

void PyPrimitive::InitType()
{
    behaviors().name("Primitive");
    behaviors().doc ("Primitive functions and classes");
    behaviors().supportGetattr();
   
    add_varargs_method("CreateCircleVB",    &PyPrimitive::CreateCircleVB,
        "VertexBuffer(Graphics, (x,y), r, col, sides, solid=False)\nVertexBuffer(Graphics, (x,y), r, col, sides, centreCol)");
    add_varargs_method("DrawLine", &PyPrimitive::DrawLine, "void(VertexBuffer, (x1,y1), (x2,y2) [,col1, col2])");
}
PyPrimitive::PyPrimitive()
{
}
PyPrimitive::~PyPrimitive()
{
}
Py::Object PyPrimitive::DrawLine(const Py::Tuple &args)
{
    try
    {
        IVertexBuffer *vb = Py::ExtensionObject<PyVertexBuffer>(args[0]).extensionObject()->GetIVertexBuffer();
       
        Py::Sequence pyp1 = args[1];
        Point2<> p1((float)Py::Float(pyp1[0]), (float)Py::Float(pyp1[1]));
       
        Py::Sequence pyp2 = args[2];
        Point2<> p2((float)Py::Float(pyp2[0]), (float)Py::Float(pyp2[1]));
       
        unsigned c1 = 0xFFFFFFFF;
        if(args.size()>=4)
            c1 = (unsigned)(__int64)Py::LongLong(args[3]);
       
        unsigned c2 = c1;
        if(args.size()>=5)
            c2 = (unsigned)(__int64)Py::LongLong(args[4]);
       
        ::DrawLine(vb, p1, p2, c1, c2);
       
        return Py::Nothing();
    }
    TRANSLATE_EXCEPTIONS//catches and rethrows any fllib::exception::, boost, or std exceptions as simelar python exception types
}
Py::Object PyPrimitive::CreateCircleVB(const Py::Tuple &args)
{
    try
    {
        ...same sort of conversion code...creates an IVertexBuffer*vb
        return Py::asObject(new PyVertexBuffer(vb));
    }
    TRANSLATE_EXCEPTIONS
}



Only a single instance of this class is generally created, and stored as "Py::ExtensionObject<PyPrimitive> primitive;" in the module object.
PyFlLib::PyFlLib()
:Py::ExtensionModule<PyFlLib>("py_fllib"),
primitive(new PyPrimitive), ..init stuff...
{
    ...init stuff
    PyPrimitive::InitType();
   
    ...methods...
   
    initialize("Python Fl Lib wrapper.");
   
    Py::Dict dict = moduleDictionary();
    ...
    dict["primitive"] = primitive;
    ...
}


Try Facebook in Windows Live Messenger! Try it Now!

Try Facebook in Windows Live Messenger! Try it Now!