I would like to be able to compile these files together and execute my macro on the command line, but so far I have been unsuccessful. I’ve considered just compiling all of this together in a shared library, as I did for TParticle.so, but it seems wrong to me, as this is just a macro with several helper functions. I’ve also tried looking at sample makefiles to use gcc to link the root libraries, my TParticle library and these macro .h and .cpp files together , but all of the makefiles are very tedious and general, and I’m just hoping to get something simple which will allow me to go to the command line and type
Thanks in advance for considering this post. I am mainly trying to learn the appropriate way to do this programming, such that I can build larger and more successful programs in the proper way.
I am facing the same problem, pcanal’s answer helped me solve at least the compiling part, but once I have compiled all the source (cpp) files using .L file.cpp+, how do I link those .so files ? Suppose I have a main macro, macro.cpp and two headers, h1.cpp, h1.h and h2.cpp and h2.h, macro.cpp calls functions from h1 and h2, after compiling them all I get macro_cpp.so, h1_cpp.so and h2_cpp.so… how to proceed ?
Repeating the same question on four threads (if I counted correctly) doesn’t get you closer to an answer but makes it more confusing for you, us and anybody else with the same question who is trying to find your solution.