Re: [OpenBabel-Devel] Crash on ring iterator

2012-05-07 Thread Craig James
Never mind ... problem solved. In the course of putting a complete example, I discovered that my Makefile had -I/usr/local/openbabel/lib/openbabel-2.0 which points to the OpenBabel 2.2.x code. In fact I was linking against a new version of OpenBabel 2.3.x, so the include files didn't match th

Re: [OpenBabel-Devel] Crash on ring iterator

2012-05-07 Thread Craig James
On Mon, May 7, 2012 at 10:09 AM, Geoffrey Hutchison wrote: > > On May 4, 2012, at 10:45 PM, Craig James wrote: > > > But it seems to be the atom iterator, not the ring iterator, that's > causing the problem. > > Huh. Here's comparable code in forcefieldmmff94.cpp: > > for(rj = (*ri)->_path.b

Re: [OpenBabel-Devel] Crash on ring iterator

2012-05-07 Thread Geoffrey Hutchison
On May 4, 2012, at 10:45 PM, Craig James wrote: > But it seems to be the atom iterator, not the ring iterator, that's causing > the problem. Huh. Here's comparable code in forcefieldmmff94.cpp: for(rj = (*ri)->_path.begin();rj != (*ri)->_path.end();rj++) { // for each ring atom

Re: [OpenBabel-Devel] Crash on ring iterator

2012-05-04 Thread Craig James
On Fri, May 4, 2012 at 6:03 PM, Igor Filippov wrote: > > I would get rlist quite the same way. This is what I have - no crashes, > though I don't iterate over the atoms quite like you do: > > vector vr = mol.GetSSSR(); > > for (vector::iterator iter = vr.begin(); iter != vr.end(); > iter++) >

Re: [OpenBabel-Devel] Crash on ring iterator

2012-05-04 Thread Igor Filippov
> From: > Igor Filippov > >To: > Craig James >Cc: > openbabel-devel@lists.sourceforge.net > Subject: > Re: [OpenBabel-Deve

Re: [OpenBabel-Devel] Crash on ring iterator

2012-05-04 Thread Igor Filippov
I would get rlist quite the same way. This is what I have - no crashes, though I don't iterate over the atoms quite like you do: vector vr = mol.GetSSSR(); for (vector::iterator iter = vr.begin(); iter != vr.end(); iter++) { num_rings++; if ((*iter)->IsAromatic()) num

[OpenBabel-Devel] Crash on ring iterator

2012-05-04 Thread Craig James
Can anyone tell me why this code crashes? It's copied almost verbatim from the OpenBabel OBRing API page. Note: I wasn't sure if the "mol->GetSSSR()" call was needed before calling mol->GetData("RingList"), so I added it to be sure. The man page wasn't clear about this. Thanks, Craig mol->Ge