Re: boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....
Michael Fabbri <[email protected]> Tue, 25 Jan 2011 08:58:28 -0800 (PST)
| Newsgroups | gmane.comp.lib.boost.langbinding |
|---|---|
| Message-ID | <[email protected]> |
--===============7095865030358174366== Content-Type: multipart/alternative; boundary="0-714737186-1295974708=:99122" --0-714737186-1295974708=:99122 Content-Type: text/plain; charset=us-ascii 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 <[email protected]> To: [email protected] 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 <[email protected]> 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 > [email protected] > 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 [email protected] https://lists.sourceforge.net/lists/listinfo/boost-langbinding --0-714737186-1295974708=:99122 Content-Type: text/html; charset=us-ascii <html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:12pt">Austin,<br>Thank you for replying so quickly.<br>Yes, I did have a name difference. I can fixed it and my init problem was resolved. <br><br>Thank you!<br><div> <br><br></div>Mike Fabbri<div><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 24pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Austin Bingham <[email protected]><br><b><span style="font-weight: bold;">To:</span></b> [email protected]<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, January 25, 2011 12:42:09 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Boost-langbinding] boost.python: ImportError: dynamic module does not define init function; bjam succesfully compiled and linked the code....<br></font><br> What is the file name of your module? I'm pretty sure that python<br>looks for an init method named after the filename of the module. In<br>your case, your module will need to be named '<a target="_blank" href="http://SciDBRemotePy.so">SciDBRemotePy.so</a>'<br>(linux) or 'SciDBRemotePy.pyd' (windows) to match the method you<br>passed to BOOST_PYTHON_MODULE.<br><br>Austin<br><br>On Tue, Jan 25, 2011 at 8:23 AM, Michael Fabbri<br><<a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a>> wrote:<br>> bjam compiles and links the following c++ file, but when the module is<br>> imported into python the error message in the subject line of this message<br>> is reported.<br>><br>><br>> class pyBase: public SciDBRemote {<br>><br>> private:<br>><br>> public:<br>><br>> SciDBRemote py_SciDB;<br>><br>> pyBase(int i) { int j = i; j++; py_SciDB = _sciDB; };<br>><br>> SciDB& getPySciDB() { return py_SciDB; }<br>><br>> };<br>><br>> BOOST_PYTHON_MODULE(SciDBRemotePy) {<br>><br>> class_<pyBase>("pyBase",init<int>())<br>><br>> .def("getPySciDB",<br>> &pyBase::getPySciDB,return_value_policy<reference_existing_object>())<br>><br>> }<br>><br>> What does this python import error means with regards to the boost.python<br>> library, and what boost.python feature must be used to resolve it?<br>><br>> Thank you<br>><br>><br>> Mike Fabbri<br>><br>><br>> ------------------------------------------------------------------------------<br>> Special Offer -- Download ArcSight Logger for FREE (a $49 USD value)!<br>> Finally, a world-class log management solution at an even better price-free!<br>> Download using promo code Free_Logger_4_Dev2Dev. Offer expires<br>> February 28th, so secure your free ArcSight Logger TODAY!<br><span>> <a target="_blank" href="http://p.sf.net/sfu/arcsight-sfd2d">http://p.sf.net/sfu/arcsight-sfd2d</a></span><br>> _______________________________________________<br>> Boost-langbinding mailing list<br>> <a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a><br>> <a href="https://lists.sourceforge.net/lists/listinfo/boost-langbinding" target="_blank">https://lists.sourceforge.net/lists/listinfo/boost-langbinding</a><br>><br>><br><br>------------------------------------------------------------------------------<br>Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!<br>Finally, a world-class log management solution at an even better price-free!<br>Download using promo code Free_Logger_4_Dev2Dev. Offer expires <br>February 28th, so secure your free ArcSight Logger TODAY! <br><a href="http://p.sf.net/sfu/arcsight-sfd2d" target="_blank">http://p.sf.net/sfu/arcsight-sfd2d</a><br>_______________________________________________<br>Boost-langbinding mailing list<br><a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a><br><a href="https://lists.sourceforge.net/lists/listinfo/boost-langbinding" target="_blank">https://lists.sourceforge.net/lists/listinfo/boost-langbinding</a><br></div></div> </div><br> </body></html> --0-714737186-1295974708=:99122-- --===============7095865030358174366== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ 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 --===============7095865030358174366== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Boost-langbinding mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/boost-langbinding --===============7095865030358174366==--