I have a C# app that generates a .cpp file. I try to compile programatically that file, using the gcc compiler like that:
private void button2_Click(object sender, EventArgs e)
{
Thread.Sleep(2000);
Process process = Process.Start(@"C:\Program Files (x86)\CodeBlocks\MinGW\bin\mingw32-gcc.exe", "-o a x.cpp");
Thread.Sleep(2000);
}
When I press the button2, after 2 seconds, appears a console (the gcc compiler) but it dissapears immediately so that I can't see it's contents.
I want to see if the code contained in x.cpp file was compiled succesfully or, if not, what are the errors generated by the gcc compiler.
Thank you respectfully.