Dear all,

I am trying to use the OpenBabel library in one of my projects. I first
copied the code on this page
http://openbabel.org/wiki/Developer:Cpp_Tutorial in an example.cpp file, and
tried to compile it for tests purpose. And it doesn't compile.

I tried the Makefile of the manual, and also "g++ -I
/home/nicolas/Programmes/OpenBabel-2.3.2/include/openbabel-2.0 -L
/home/nicolas/Programmes/OpenBabel-2.3.2/lib -lopenbabel example.cpp -o
example".

The error is:
/tmp/cc2kfqde.o: In function `main':
example.cpp:(.text+0x120): undefined reference to
`OpenBabel::OBConversion::OBConversion(std::istream*, std::ostream*)'
example.cpp:(.text+0x139): undefined reference to
`OpenBabel::OBConversion::SetInAndOutFormats(char const*, char const*)'
example.cpp:(.text+0x165): undefined reference to
`OpenBabel::OBConversion::Convert()'
example.cpp:(.text+0x19e): undefined reference to
`OpenBabel::OBConversion::~OBConversion()'
example.cpp:(.text+0x1e1): undefined reference to
`OpenBabel::OBConversion::~OBConversion()'
collect2: error: ld returned 1 exit status

I have looked in the archive of the mailing list but I have not found any
answer for Linux (only Windows). My understanding is that it is related to
some library path error.

I am using Linux Mint (which is based on ubuntu). I tried with the openbabel
package installed, then removed it and install OpenBabel by myself. In my
.bashrc I have added:
export OPENBABEL=/home/nicolas/Programmes/OpenBabel-2.3.2/bin
PATH=$OPENBABEL:$PATH

I have also tried with and without the following lines (also in .bashrc):
export OPENBABEL_LIB=/home/nicolas/Programmes/OpenBabel-2.3.2/lib
export LD_LIBRARY_PATH=$OPENBABEL_LIB:$LD_LIBRARY_PATH

The error is always the same. Is there anyone who have an idea?

Thanks a lot.

Nicolas



--
View this message in context: 
http://forums.openbabel.org/Problem-for-compiling-the-example-files-tp4656837.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to