how to run gcc.exe from c# in .net

April 17, 2011 at 21:40:57
Specs: Windows XP
ProcessStartInfo mypro = new ProcessStartInfo("d:/djgpp/bin/gcc.exe ", " d:/hello.c -o d:/hello.exe");
mypro.UseShellExecute = false;
mypro.RedirectStandardOutput=true;
Process pro1 = new Process();
pro1.startInfo=mypro;
pro1.Start();


This is giving "parameter is in correct" in line pro1.start()
can anybody pls help me in solving dis.


See More: how to run gcc.exe from c# in .net

Report •


#1
April 17, 2011 at 23:59:03
I'd start by using "\\" where you have "/" in line 1.

Report •

#2
April 18, 2011 at 05:00:04
Conveniently, Win32 allows you to use "/" instead of "\\" (as long as you're not passing a UNC).

Your code runs fine as is, if you change "pro1.startInfo=mypro;" to "pro1.StartInfo=mypro;"

How To Ask Questions The Smart Way


Report •

#3
April 18, 2011 at 05:15:21
Point taken. The mystery is, how did the program compile with that error?

Report •

Related Solutions

#4
April 18, 2011 at 20:56:46
Thanks for the reply.
I had used StartInfo only. it is just a typing mistake.
The above code runs fine in visual studio 2008 but its giving error in vs2005.

Report •

#5
April 21, 2011 at 17:53:04
If I had to guess, and I will unless I reinstall VS2005, I'd say the problem is the space between the "gcc.exe" and the ending double quote.

How To Ask Questions The Smart Way


Report •


Ask Question