From bc9746db6ce52d94262b622f37b104723afadb04 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Fri, 15 May 2015 10:41:08 -0500 Subject: [PATCH] Fix #55: Fix problem in stringstream declaration --- .../MonteCarlo/src/MonteCarlo_slave_process_run.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/trick_source/sim_services/MonteCarlo/src/MonteCarlo_slave_process_run.cpp b/trick_source/sim_services/MonteCarlo/src/MonteCarlo_slave_process_run.cpp index 565ccbd6..f83599c3 100644 --- a/trick_source/sim_services/MonteCarlo/src/MonteCarlo_slave_process_run.cpp +++ b/trick_source/sim_services/MonteCarlo/src/MonteCarlo_slave_process_run.cpp @@ -110,7 +110,8 @@ int Trick::MonteCarlo::slave_process_run() { } } - std::stringstream ss_monte_input << output_dir << "/monte_input"; + std::stringstream ss_monte_input; + ss_monte_input << output_dir << "/monte_input"; FILE *fp = fopen(ss_monte_input.str().c_str(), "w"); fprintf(fp, @@ -123,9 +124,11 @@ int Trick::MonteCarlo::slave_process_run() { delete [] input; /**
  • redirect stdout and stderr to files in the run directory */ - std::stringstream ss_stdout << output_dir << "/stdout"; + std::stringstream ss_stdout; + ss_stdout << output_dir << "/stdout"; freopen(ss_stdout.str().c_str(), "w", stdout); - std::stringstream ss_stderr << output_dir << "/stderr"; + std::stringstream ss_stderr; + ss_stderr << output_dir << "/stderr"; freopen(ss_stderr.str().c_str(), "w", stderr); /**
  • Run the pre run jobs. */