I don't have this problem on mac/windows, but it came up on Linux. Rather
than figure out which library or libraries to link twice I just use the
idiom
--start-group -llib1 -llib2 -llib3 --end-group
Maybe that will help with your issue.
Jason
On Mon, Sep 14, 2020 at 10:46 AM topgunhaides <[email protected]> wrote:
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss