boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....

Michael Fabbri

bjam compiles and links the following c++ file, but when the module is imported into python the error message in the subject line of this message is reported.



class pyBase: public SciDBRemote {

          private:

public:

SciDBRemote py_SciDB;

pyBase(int i) { int j = i; j++; py_SciDB = _sciDB; };

SciDB& getPySciDB() { return py_SciDB; }

};


BOOST_PYTHON_MODULE(SciDBRemotePy) {

class_<pyBase>("pyBase",init<int>())


          .def("getPySciDB", &pyBase::getPySciDB,return_value_policy<reference_existing_object>())

}

What does this python import error means with regards to the boost.python library, and what boost.python feature must be used to resolve it?


Thank you

 
Mike Fabbri



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....

Austin Bingham
What is the file name of your module? I'm pretty sure that python
looks for an init method named after the filename of the module. In
your case, your module will need to be named 'SciDBRemotePy.so'
(linux) or 'SciDBRemotePy.pyd' (windows) to match the method you
passed to BOOST_PYTHON_MODULE.

Austin

On Tue, Jan 25, 2011 at 8:23 AM, Michael Fabbri
<[hidden email]> wrote:

> bjam compiles and links the following c++ file, but when the module is
> imported into python the error message in the subject line of this message
> is reported.
>
>
> class pyBase: public SciDBRemote {
>
>           private:
>
> public:
>
> SciDBRemote py_SciDB;
>
> pyBase(int i) { int j = i; j++; py_SciDB = _sciDB; };
>
> SciDB& getPySciDB() { return py_SciDB; }
>
> };
>
> BOOST_PYTHON_MODULE(SciDBRemotePy) {
>
> class_<pyBase>("pyBase",init<int>())
>
>           .def("getPySciDB",
> &pyBase::getPySciDB,return_value_policy<reference_existing_object>())
>
> }
>
> What does this python import error means with regards to the boost.python
> library, and what boost.python feature must be used to resolve it?
>
> Thank you
>
>
> Mike Fabbri
>
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Boost-langbinding mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/boost-langbinding
>
>

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....

Michael Fabbri
Austin,
Thank you for replying so quickly.
Yes, I did have a name difference.  I can fixed it and my init problem was resolved.

Thank you!
 

Mike Fabbri



From: Austin Bingham <[hidden email]>
To: [hidden email]
Sent: Tue, January 25, 2011 12:42:09 AM
Subject: Re: [Boost-langbinding] boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....

What is the file name of your module? I'm pretty sure that python
looks for an init method named after the filename of the module. In
your case, your module will need to be named 'SciDBRemotePy.so'
(linux) or 'SciDBRemotePy.pyd' (windows) to match the method you
passed to BOOST_PYTHON_MODULE.

Austin

On Tue, Jan 25, 2011 at 8:23 AM, Michael Fabbri
<[hidden email]> wrote:

> bjam compiles and links the following c++ file, but when the module is
> imported into python the error message in the subject line of this message
> is reported.
>
>
> class pyBase: public SciDBRemote {
>
>           private:
>
> public:
>
> SciDBRemote py_SciDB;
>
> pyBase(int i) { int j = i; j++; py_SciDB = _sciDB; };
>
> SciDB& getPySciDB() { return py_SciDB; }
>
> };
>
> BOOST_PYTHON_MODULE(SciDBRemotePy) {
>
> class_<pyBase>("pyBase",init<int>())
>
>           .def("getPySciDB",
> &pyBase::getPySciDB,return_value_policy<reference_existing_object>())
>
> }
>
> What does this python import error means with regards to the boost.python
> library, and what boost.python feature must be used to resolve it?
>
> Thank you
>
>
> Mike Fabbri
>
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Boost-langbinding mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/boost-langbinding
>
>

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Loading...