On Tue, Nov 5, 2013 at 7:26 AM, Dimitri Maziuk <dmaz...@bmrb.wisc.edu>wrote:
> On 2013-11-05 08:34, Craig James wrote:
>
> > I don't know if it's something specific to OpenBabel, or a more general
> > problem with C/C++. I have to believe it's OpenBabel, because I know
> > lots of projects use libraries written in C++ linked to executables
> > written in C.
>
> Generally speaking it requires writing an interface layer: wrapping code
> that throws exceptions, declaring objects as structs, declaring
> everything 'extern C', etc.
>
Of course. Any C/C++ programmer knows that, and that's what swig is all
about. The problem is much more subtle -- it seems to be that the run-time
linker doesn't call the C++ constructors correctly for OpenBabel's
plug-ins. I believe it has to do with plug-ins within plug-ins. That is,
Perl dynamically loads the OpenBabel swig-generated wrappers, which works
correctly; all the class load-time code initializers are run. But then
when OpenBabel tries to dynamically load its own libraries (the file
modules like mdlformat.cpp), it fails to call all of the constructors
and/or initialization code, so the classes aren't initialized properly.
But that's just the best I've been able to deduce from the symptoms. It
could be something else. All I know for sure is that I couldn't get it to
work, and several others also tried and failed.
Craig
>
> Dima
>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models.
> Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss