On 03/02/12 10:12, Nicholas Firth wrote:
Hi All,
This is inevitably going to be a silly question, as it's been some
years since I've used C++ for anything that required a library. So
I've managed to get RDKit working fine on Python (OSX 10.7.2) as far
as I can tell it all works perfectly. Now I have to change over to
C++, I'm trying to compile the simplest program that I can just to
insure I've got all the paths and linking set up. The program is
#include <iostream>
#include "RDLog.h"
int main(){
return 0;
}
And then at command line I get:
nfirth$ g++ reader.cpp -L /Users/nfirth/Code/RDKit/
reader.cpp:10:19: error: RDLog.h: No such file or directory
I assume that this is just me forgetting how to link correctly or set
paths correctly but for the life of me I can't get google to give me
the right answer!
It seems to me that this is a compiling error - not a linking error.
What you need is to specify the directory to find RDLog.h.
Actually, even that is not quite right. Let's imagine that RDKit prefix
(CMAKE_INSTALL_PREFIX) is /Users/nfirth/Code/RDKit - so in there you
will find include and in include you will find rdkit and in rdkit you
will find RDGeneral (and other directories) and in RDGeneral you will
find RDLog.h. right?
However, I believe it is more standard (and sane) to use the directory
and the header file-name in your source file, i.e.:
#include <RDGeneral/RDLog.h>
and then you need only specify to the compile one directory to find the
RDKit headers, i.e. add -I /Users/nfirth/Code/RDKit/include/rdkit to the
compile line.
Presumably you will also need -L/Users/nfirth/Code/RDKit/lib -lRDGeneral
when linking.
HTH,
Paul.
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss