Dear Geant4-ers, I was given a code of a program written in Geant 4 to get into it. When I started to compile it I found some incompatibilities. For example the #include <vector> was not enough, and I had to include 'using namespace std;' to get it to work. Then I wonder how some classes, where 'cout' and 'endl' were used, could work without including the library <iostream.h>. OKAY. The program uses also the graphics from Root. Afterwards, when all the errors were managed, when running it the program crashes, saying: The Segmentation Violation. I found that this crashing comes at the line runManager->Initialize(); Another supicious thing. As I said the program uses the Root (I have Root 3.05). And in the errors list (when executing the program) I see some errors when the program should use some Root libraries. But it finds them, so I think the error is not there. I don't have a clue what should I do. Do some of you know where the problem is or any comments on this? Excuse me if my question was childish. I've never programmed in Geant before. But I like the case that it is in C++!!! Have a Nice Work! Kind Regards, Oleg.
> I was given a code of a program written in Geant 4 to get into it. When I > started to compile it I found some incompatibilities. For example the > #include <vector> was not enough, and I had to include 'using namespace std;' > to get it to work. In C++ you need to use std::vector when using STL containers. This is standard C++ syntax. > Then I wonder how some classes, where 'cout' and 'endl' were used, > could work without including the library <iostream.h>. OKAY. To use standard C++ you need to include <iostream> for std::cout and std::endl. Again, standard C++ syntax. > The program uses also the graphics from Root. Afterwards, when all the > errors were managed, when running it the program crashes, saying: The > Segmentation Violation. I found that this crashing comes at the line > runManager->Initialize(); > Another supicious thing. As I said the program uses the Root (I have Root > 3.05). And in the errors list (when executing the program) I see some errors > when the program should use some Root libraries. But it finds them, so I > think the error is not there. It is not clear from this report what is problem ... If errors are originated from Root libraries, it is more likely there's a problem in Root, or in the way it has been interfaced to Geant4.