| Message: Compile differences between RedHat and Windows | Not Logged In (login) |
|
After some modification of novice N03 I'm printing information out to a text file with the following statements:
////////////////////////////////////////////////
void ExN03SteppingVerbose::TrackingStarted()
////////////////////////////////////////////////
{
ofstream outFile("outfile.txt",ios::app);
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
if (fTrack->GetDefinition()->GetParticleName() == "gamma"){
outFile << fTrack->GetDefinition()->GetParticleName()<< " "
<< G4std::setw( 10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")<< G4endl;
}
}
}
This compiles and works fine on my RedHat installation but when I take the exact same routines and compile them with my windows installation I get the following errors: Compiling ExN03SteppingVerbose.cc ... ExN03SteppingVerbose.cc src/ExN03SteppingVerbose.cc(52) : error C2065: 'ofstream' : undeclared identifier src/ExN03SteppingVerbose.cc(52) : error C2146: syntax error : missing ';' before identifier 'outFile' src/ExN03SteppingVerbose.cc(52) : error C2065: 'outFile' : undeclared identifier src/ExN03SteppingVerbose.cc(52) : error C2653: 'ios' : is not a class or namespace name src/ExN03SteppingVerbose.cc(52) : error C2065: 'app' : undeclared identifier I obtained the pre-compiled windows build from the users workshop at SLAC and am able to compile and run the T01 tutorial on my windows installation so it seems like its installed correctly. What am I missing? I use the G4cout "method?" frequently to print informaiton to the screen. Is there a similiar "method?" to get that information into a text file? Regards, Dennis Haggerty |
| Inline Depth: | Outline Depth: | Add message: |
|
to: |