newbie compiling issues

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

newbie compiling issues

Prashanth Athri

Dear List,

 

I just downloaded and installed OpenBabel locally (non-root) and set $PATH and $LD_LIBRARY_PATH as per instructions.

 

When I try to compile the example code:

 

#include <iostream>

#include <openbabel/mol.h>

int main ()

{}

 

With the command:

g++ -Wall -L/home/athri/openbabel-2.2.3/src/.libs/  -I/home/athri/openbabel-2.2.3 ./ex-1.cpp -o ex1

 

[based on an older post: http://open-babel.957263.n4.nabble.com/C-example-and-babelconfig-h-td958991.html]

 

The compiler does not find mol.h [“openbabel/mol.h: No such file or directory"]

 

I am not sure how to link the header.

 

Any help will be appreciated.

 

Thanks,

Prashanth

 
[PS: Sorry if this mail is in duplicate, I tried to post this yesterday, but didnt show up on the list]


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: newbie compiling issues

Geoffrey Hutchison
> g++ -Wall -L/home/athri/openbabel-2.2.3/src/.libs/  -I/home/athri/openbabel-2.2.3 ./ex-1.cpp -o ex1
...
> The compiler does not find mol.h [“openbabel/mol.h: No such file or directory"]

Well, if you want the header, you'd need something like:

g++ -Wall -I/home/athri/openbabel-2.2.3/include -L/home/athri/openbabel-2.2.3/src/.libs ex-1.cpp -o ex1 -lopenbabel

(You will also need to link in the libopenbabel binary.)

This isn't the most reliable technique -- you really should be installing the headers and libraries somewhere, rather than trying to link against the objects in the build tree.

Hope that helps,
-Geoff
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss