Hi all,

     I tried to compile the C++ program listed in the openbabel web site 
(http://openbabel.org/docs/dev/UseTheLibrary/CppExamples.html#using-makefiles) 
according to the instructions of "How to compile against the open babel 
library". But some errors occurred. The hints given by the compiler are " 
OBConversion was not declared in this scope ", OBMol was not declared in this 
scope. The Makefile is :

CC= g++
CFLAGS= -c -I 
/home/duanbg/program/openbabel-2.3.2/include/openbabel-2.0LDFLAGS= -lopenbabel 
-L /home/duanbg/program/openbabel-2.3.2/lib

all: example

example: example.o
      $(CC)$(LDFLAGS) example.o -o example

example.o: example.cpp
      $(CC)$(CFLAGS)$(LDFLAGS) example.cpp

clean:
      rm -rf example.o example

**********************************

//example.cpp

#include <iostream>

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

intmain(intargc,char**argv)
{
  OBConversionobconversion;
  obconversion.SetInFormat("sdf");
  OBMolmol;

  boolnotatend=obconversion.ReadFile(&mol,"../xsaa.sdf");
  while(notatend)
  {
    std::cout<<"Molecular Weight: "<<mol.GetMolWt()<<std::endl;

    mol.Clear();
    notatend=obconversion.Read(&mol);
  }

  return(0);
}
*****************************************

Would you like to give me some help? Thanks in advance.

 

Best Wishes

Baogen Duan

 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to