ImportError when using ReferenceCount objects

Return to Scripting Issues

ImportError when using ReferenceCount objects

Postby vash » Thu Apr 05, 2012 9:06 am

Hello,

We're currently trying to upgrade from panda3d 1.7.2 to 1.8.0 in our software, and we are now stuck with an issue we don't really understand :

I have a C++ class that inherits from ReferenceCount, in order to make it compatible with panda smart pointers. The library is then compiled into a pyd library and imported from a python program.
It works fine with 1.7.2 in the "standalone" software as well as in the web plugin. With the 1.8.0 version, it still works perfectly in standalone program, but inside the plugin we get the following error :

Code: Select all
ImportError: DLL load failed: Specified procedure could not be found


when using "import mylib"

Even the simplest class like :


Code: Select all
class DummyClass : public ReferenceCount {
public:
PUBLISHED:
    DummyClass() : ReferenceCount()
    {
    }
   
    DummyClass(int dummyParameter) : ReferenceCount()
    {
        dummyVar = dummyParameter();
    }
   
    virtual ~DummyClass()
    {
    }
   
protected:
    int dummyVar;
};


seems to fail to be imported. However, using PNMImage (or some other classes) instead of ReferenceCount seems to work fine in this example.
I've read that it could be a wrong dll used somewhere, or a bad path, but I can't figure out where to check.

Any ideas are welcome
Thanks,
Vash
vash
 
Posts: 94
Joined: Thu Apr 28, 2011 9:55 am

Postby rdb » Wed Apr 18, 2012 1:32 pm

You need to compile it differently for it to work with the plugin. Search around the forums; it probably involves some preprocessor flags like unsetting DO_MEMORY_USAGE and setting NDEBUG.
rdb
 
Posts: 8575
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands


Return to Scripting Issues

Who is online

Users browsing this forum: No registered users and 2 guests