Message: Compile differences between RedHat and Windows Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Compile differences between RedHat and Windows 

Keywords: Windows RedHat compile differences
Forum: User Requirements
Date: 20 Mar, 2002
From: Dennis Haggerty <Dennis Haggerty>

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:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Compile differences between RedHat and Windows   (Gabriele Cosmo - 08 Apr, 2002)
 Add Message Add Message
to: "Compile differences between RedHat and Windows"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]