segmentation fault in OBBuilder.Build()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

segmentation fault in OBBuilder.Build()

Martin Guetlein
Hello All,

I came across an example that causes OBBuilder to produce a
segmentation fault (g++ version is 4.4.3, openbabel-2.2.3). See code
below.

Best regards,
Martin


#include <iostream>
#include <openbabel/mol.h>
#include <openbabel/obconversion.h>
#include <openbabel/builder.h>

using namespace std;
using namespace OpenBabel;

int main(int argc,char **argv)
{
        OBMol * mol = new OBMol();
        OBConversion obconversion;
        obconversion.SetInFormat("smiles");
        //obconversion.ReadString(mol, "C1(N=C(NC(C)C)N=C(N=1)OC)NC(C)C");
        obconversion.ReadString(mol,
"OC1=CC3=C([C@@]2([H])CC[C@@]4(C)[C@](CC[C@@H]4O)([H])[C@@]([H])2[C@H](CCCCCCCCCS(CCCC(F)(F)C(F)(F)F)=O)C3)C=C1");
        cout << "formula "<< mol->GetFormula() << "\n";
        cout << "Has3D: " << mol->Has3D() << "\n";
        OBBuilder builder;
        builder.Build(*mol);
        cout << "Has3D: " << mol->Has3D() << "\n";
        delete(mol);
        return 0;
}

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss