I have been trying to do these in a brand new project, and this is OK.
But when i try to add such code in my old code, there still problems so maybe there is something conflicing with each other ?
[quote]But when i try to add such code in my old code, there still problems so maybe there is something conflicing with each other ?[/quote]I have no clue since I do not know what your old or even your new code look like
[quote=“pcanal”][quote]But when i try to add such code in my old code, there still problems so maybe there is something conflicing with each other ?[/quote]I have no clue since I do not know what your old or even your new code look like
Cheers,
Philippe.[/quote]
i am sorry, the “old code” is a large project written by others, i just want to add some function on it.
the “new code” i mentiened is just a brand new main() function that do nothing but importing the library.
in the later case, i can know that such method is possible, but i do not know why it did not work in the old one.
and when the programm run to this point, the error reads:
dlopen error: /home/zweng/root/lib/libRIO.so: undefined symbol: _ZTV11TCollection
Load Error: Failed to load Dynamic link library /home/zweng/root/lib/libRIO.so
dlopen error: /home/zweng/root/lib/libMatrix.so: undefined symbol: gROOT
Load Error: Failed to load Dynamic link library /home/zweng/root/lib/libMatrix.so
Error in TCint::AutoLoadCallback: failure loading dependent library libMatrix.so for class TLorentzVector
dlopen error: /home/zweng/root/lib/libPhysics.so: undefined symbol: _ZTV7TString
Load Error: Failed to load Dynamic link library /home/zweng/root/lib/libPhysics.so
Error in TCint::AutoLoadCallback: failure loading library libPhysics.so for class TLorentzVector
When i try to import other library simily message appears.
But when i do this in a brand new code, this process is OK.
In the old code case, what are the error messages?
Philippe.[/quote]
i just realize that in the case of the new code, i use root-config --libs to load the basic root library in the compiler
but in the old project, there is already a -static option in the linking command so maybe this prevent the linking of the basic root library , and i do not know how to link a share library ( libGeom.so for example) when the -static option is on.
This is possible. You can build the root static library by doingcd $ROOTSYS;
make static
Cheers,
Philippe.[/quote]
Thank you for your reply. Actually i had already try to link the root static library in the compiling, but it seems not solve the problem. It seems to me that the static library do not include all the necessary function ? Or i need to specify the sub-library that built into the root static library ?