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

Austin Bingham <[email protected]> Tue, 25 Jan 2011 09:42:09 +0100
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
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 {
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 private:
>
> public:
>
> SciDBRemote py_SciDB;
>
> pyBase(int i) { int j =3D i; j++; py_SciDB =3D _sciDB; };
>
> SciDB& getPySciDB() { return py_SciDB; }
>
> };
>
> BOOST_PYTHON_MODULE(SciDBRemotePy) {
>
> class_<pyBase>("pyBase",init<int>())
>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0 .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-fr=
ee!
> 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