Dear Greg;
Thank you for the file and the suggestion. I tried following the examples
and your suggestion and yet, I am still getting some errors. Here is my code
and below are the errors:
#include <GraphMol/RDKitBase.h>
#include <string>
#include <iostream>
#include <fstream>
#include <map>
#include <GraphMol/FileParsers/MolSupplier.h>
#include <GraphMol/FileParsers/MolWriters.h>
#include <GraphMol/FileParsers/FileParsers.h>
#include <RDGeneral/FileParseException.h>
#include <RDGeneral/BadFileException.h>
#include <RDGeneral/RDLog.h>
#include <GraphMol/SmilesParse/SmilesWrite.h>
#include <GraphMol/SmilesParse/SmilesParse.h>
#include <GraphMol/Depictor/RDDepictor.h>
using namespace RDKit;
int main()
{
SDMolSupplier supplier("Pubchem_info_dat.sdf");
int i = 0;
while (!supplier.atEnd())
{
ROMol *nmol = supplier.next();
i++;
}
return 0;
}
Compilation line:
g++ -I${RDBASE}/Code -L/${RDBASE}/lib test.c
Error:
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/hash_set:60,
from /usr/include/boost/graph/adjacency_list.hpp:25,
from /usr/gapps/bbs/rdkit-master//Code/GraphMol/ROMol.h:24,
from /usr/gapps/bbs/rdkit-master//Code/GraphMol/GraphMol.h:19,
from /usr/gapps/bbs/rdkit-master//Code/GraphMol/RDKitBase.h:25,
from test.c:1:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/backward_warning.h:28:2:
warning: #warning This file includes at least one deprecated or antiquated
header which may be removed without further notice at a future date. Please use
a non-deprecated interface with equivalent functionality instead. For a listing
of replacement headers and interfaces, consult the file backward_warning.h. To
disable this warning use -Wno-deprecated.
/var/tmp/swong/ccJYjg6o.o: In function `main':
test.c:(.text+0x4b): undefined reference to
`RDKit::SDMolSupplier::SDMolSupplier(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)'
test.c:(.text+0xcd): undefined reference to `RDKit::SDMolSupplier::next()'
test.c:(.text+0xe1): undefined reference to `RDKit::SDMolSupplier::atEnd()'
/var/tmp/swong/ccJYjg6o.o: In function
`RDKit::ForwardSDMolSupplier::~ForwardSDMolSupplier()':
test.c:(.text._ZN5RDKit20ForwardSDMolSupplierD2Ev[_ZN5RDKit20ForwardSDMolSupplierD5Ev]+0x16):
undefined reference to `vtable for RDKit::ForwardSDMolSupplier'
/var/tmp/swong/ccJYjg6o.o: In function `RDKit::SDMolSupplier::~SDMolSupplier()':
test.c:(.text._ZN5RDKit13SDMolSupplierD2Ev[_ZN5RDKit13SDMolSupplierD5Ev]+0x16):
undefined reference to `vtable for RDKit::SDMolSupplier'
collect2: ld returned 1 exit status
Do you think I need to re-install rdkit? The python wrapper works fine.
Thanks again;
-Sergio
________________________________
From: Greg Landrum [greg.land...@gmail.com]
Sent: Monday, July 13, 2015 10:16 PM
To: Wong, Sergio E.
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] problem using RDKit c++ class to read sdf file
Hi Sergio,
You need to provide the filename when you construct the SDMolSupplier.
Here's some sample code from one of the RDKit tests that demonstrates how to
use the supplier:
https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/FileParsers/testMolSupplier.cpp#L42
(that file contains other examples of using the suppliers too)
-greg
On Tue, Jul 14, 2015 at 7:10 AM, Wong, Sergio E.
<wong...@llnl.gov<mailto:wong...@llnl.gov>> wrote:
Dear RDKit users;
I am trying to read a sdf file using the following code:
#include<stdlib.h>
#include<GraphMol/FileParsers/MolSupplier.h>
#include<RDGeneral/FileParseException.h>
#include<RDGeneral/BadFileException.h>
#include<RDGeneral/RDLog.h>
#include<GraphMol/RDKitBase.h>
int main()
{
RDKit::SDMolSupplier supplier;
supplier.init();
supplier.SDMolSupplier("PubChem_info_dat.sdf");
return 0;
}
When I try to compile it, I get the following error:
test.c: In function ‘int main()’:
test.c:19:10: error: invalid use of ‘RDKit::SDMolSupplier::SDMolSupplier’
supplier.SDMolSupplier("PubChem_info_dat.sdf");
^
Can anyone suggest anything?
Thanks!
-Sergio
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net<mailto:Rdkit-discuss@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss