Hello World

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

Hello World

Seth Call
On Ubuntu 10, I'm trying to compile this hello world program at:

     http://openbabel.org/api/2.2.0/start.shtml

The c++ and make files I'm using are attached.

I am getting the attached errors indicating it can't include the open babel libraries.

To install open babel, I used the synaptic package manager.  I tried installing the openbabel, libopenbabel3, and libopenbabel-dev packages.

I also tried uninstalling these packages and then installing via the instructions at (installed globally with root access):

http://openbabel.org/wiki/Install_%28source_code%29

This seems to have the same effect as installing the openbabel package with the synaptic package manager.  The install output did NOT indicate that the libxml package is installed, though the instructions indicate that most functionality will still be there without it.

The instructions indicate that you have to set the LD_LIBRARY_PATH environment variable to include the directory where the libopenbabel.so file is.  I typed 'locate openbabel', and the only .so files were these:

/usr/lib/libopenbabel.so.3
/usr/lib/libopenbabel.so.3.0.3
/usr/local/lib/libopenbabel.la
/usr/local/lib/libopenbabel.so
/usr/local/lib/libopenbabel.so.3
/usr/local/lib/libopenbabel.so.3.0.3

I accordingly typed: export LD_LIBRARY_PATH=/usr/local/lib (the LD_LIBRARY_PATH variable was empty before).

While the openbabel program is available via the command line, the above program still can't find the include libraries.  I'm I missing something?

Seth



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Makefile (244 bytes) Download Attachment
test.cc (918 bytes) Download Attachment
errors.txt (994 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Hello World

Steffen Neumann
On Sat, 2010-09-25 at 21:14 -0700, Seth Call wrote:
>      http://openbabel.org/api/2.2.0/start.shtml
...
> installing the openbabel, libopenbabel3, and libopenbabel-dev
                                               ^^^^^^^^^^^^^^^^^
This is the important one, since it caontains the *.h header files.

> The instructions indicate that you have to set the LD_LIBRARY_PATH
That's only important after compiling, during runtime.

> above program still can't find the include libraries.  I'm I missing
>  something?
Yup :-)

you need CXXFLAGS=-I/usr/include/openbabel-2.0/ to point
your compiler there. You could also use pkg-config
in you rMakefile environment:

        pkg-config --libs openbabel-2.0

but I never used it myself, google might help you there.

Yours,
Steffen

P.S.: It might be a good idea to consult somebody with C/C++ experience,
or read some of the basics and tutorial, because I fear you'll stumble
upon more compile/link/runtime problems as you go.


--
IPB Halle                    AG Massenspektrometrie & Bioinformatik
Dr. Steffen Neumann          http://www.IPB-Halle.DE
Weinberg 3                   http://msbi.bic-gh.de
06120 Halle                  Tel. +49 (0) 345 5582 - 1470
                                  +49 (0) 345 5582 - 0
sneumann(at)IPB-Halle.DE     Fax. +49 (0) 345 5582 - 1409


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss