Hi guys,

I am trying to get an executable that doesn't require an RDKit install to
run.
But found it is tricky to figure out the correct order of static libraries
for linking.

Here is my dynamic linkage (successful):

g++ -o test.exe test.cpp \
    -I$RDBASE/Code -L$RDBASE/lib \
    -lRDKitFileParsers \
    -lRDKitRDGeneral \
    -lRDKitDescriptors \
    -lRDKitDistGeomHelpers \
    -lRDKitForceField \
    -lRDKitForceFieldHelpers \
    -lRDKitMolAlign \
    -lRDKitShapeHelpers \
    -lRDKitGraphMol

My RDKit-related header files in the code:

#include <GraphMol/GraphMol.h>
#include <GraphMol/FileParsers/MolSupplier.h>
#include <GraphMol/Descriptors/MolDescriptors.h>
#include <GraphMol/MolOps.h>
#include <GraphMol/MolAlign/AlignMolecules.h>
#include <GraphMol/DistGeomHelpers/Embedder.h>
#include <GraphMol/ForceFieldHelpers/UFF/UFF.h>
#include <GraphMol/ForceFieldHelpers/MMFF/MMFF.h>
#include <GraphMol/ShapeHelpers/ShapeUtils.h>
#include <GraphMol/FileParsers/MolWriters.h>

However, I still cannot figure out the correct static linkages. Here is one
example:

g++ -o test.exe test.cpp \
    -I$RDBASE/Code -L$RDBASE/lib \
    -lRDKitForceFieldHelpers_static \
    -lRDKitForceField_static \
    -lRDKitRDGeneral_static \
    -lRDKitShapeHelpers_static \
    -lRDKitDistGeomHelpers_static \
    -lRDKitGraphMol_static \
    -lRDKitMolAlign_static \
    -lRDKitFileParsers_static \
    -lRDKitDescriptors_static

which gave me a bunch of "undefined reference" errors.

I guess that circular dependencies exist. I found some old discussions, but
the info is limited.
I mean shall we have documentation to explain those dependencies to help
establish static linkage?
Can anyone help me with this? Maybe with a couple of examples? I appreciate
it!

Best,
Leon
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to