We are building a cloud service to provide"Compilation As A Service". We have an Ubuntu 12.04 VM on Azure. We managed to install GCC on the VM as well. Now we are building the frontend on Visual Studio. In that we have a text box which would hold the code. But we are unable to figure out how to use GCC to process the code?
Currently we are using something like this;
string log = @"C:\log.c";
using (FileStream fs = new FileStream(log, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write(TextBox1.Text);
sw.Close();
}
}
string szMgwGCCPath = "/usr/bin/gcc"; // Example of location
string szArguments = " -c log.c -o log.exe"; // Example of arguments
ProcessStartInfo gccStartInfo = new ProcessStartInfo(szMgwGCCPath, szArguments);
gccStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(gccStartInfo);
I am not sure what parts of it is right. Since we are unable to test it as the compiler is stored on the clod.
string szMgwGCCPath = "/usr/bin/gcc"; // Example of location
How do we give the location? Do we use the blob storage URL? How to do that?
How do we process the file after that?