When linking with a library, you can see the list of dependencies of this library by looking at the corresponding rootmap file in $ROOTSYS/lib, eg in $ROOTSYS/lib/libTreeViewer.rootmap, you will find this:
I think that this is not possible since I need to use the same Makefile for Mac and Linux,
and I don’t think that R will be able to compile my package.
Furthermore, this does not answer my question if this problem also exists on Linux and Mac Leopard.
[quote]Furthermore, this does not answer my question if this problem also exists on Linux and Mac Leopard. [/quote]Yes it turns out that you problem is not Tiger specific … If you use the same technique on Linux and newer Mac you will end with the same result.
The question that I have is if I need to add also something to LDFLAGS?
More generally:
Looking at the main root Makefile I see that it is used to force linking of not referenced libraries.
What does “not referenced libraries” mean?
How do I know which libraries are not referenced?
On windows the linker pulls in from the library only the symbol that used directly or indirectly in the .o file that are passed.
For ROOT to function properly the dictionary needs to be loaded. However no code is referring to any of the symbol defined in the dictionary. So in order for the dictionary to be properly linked-in we need to explicit request them. This is done via the ‘-include:_G__cpp_setupG__Hist’ which request one of the symbol defined the dictionary for libHist. Usually the ROOT dictionary for a ROOT library XYZ is named G__XYZ and one symbol defined is _G__cpp_setupG__XYZ. So libGed you need to add -include:_G__cpp_setupG__Ged
Thank you for your explanation.
Interestingly, on WinXP my program works with the current setting of my Makefile, i.e. w/o adding -include:_G__cpp_setupG__Ged.
However, I will add it anyhow, but I do not understand why it works.