Our bad. Precede everything by OpenBabel::, e.g.
OpenBabel::OBConversion, OpenBabel::OBMol

On 14 May 2015 at 08:43,  <duanbao...@iccas.ac.cn> wrote:
>
> 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.0
> LDFLAGS = -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>
>
> int main(int argc,char **argv)
> {
>   OBConversion obconversion;
>   obconversion.SetInFormat("sdf");
>   OBMol mol;
>
>   bool notatend = 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
>

------------------------------------------------------------------------------
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