I have written a program that makes use several root-libraries as well as a simple makefile (Makefile.txt (374 Bytes)
) to compile the program. I’m able to compile my programs without any problem. However, today I have encountered a strange situation when I try to add a simple grid to my graph. In my compiled program the method “SetGrid()” only adds one grid perpendicular to the x-axis. Here is a minimal working example that reproduces the problem on my system:
thank you for your reply. I have changed the code according to your recommendations, unfortunately this does not fix my problem. However, today I have compiled the source code on another system that has the very same root-version installed on it. This time the program generated the correct output, so there must be something wrong with my system or my root-version is corrupted.
Does anyone knows a solution for this problem or should I consider reinstalling root?
You can try reinstalling ROOT to make sure it is not an installation problem.
If the problem still appears then it might be that somewhere (in your code or in ROOT) there is an uninitialized memory used leading to ‘random’ behavior. To understand whether it is the case you can run your example under valgrind (if you are running the root executable make sure to use the one (literrally) named root.exe).