Hi. I'm making small application what will do c++ programs compiling easier. I have this code:

System.Diagnostics.Process.Start("C:\\Alps\\compiler\\H-i586-cygwin32\\bin\\g++.exe", "-c Main.cpp -o main.o ");

This code should start

g++.exe

with arguments

-c Main.cpp -o main.o

for compiling main cpp file to o file. Can you see any error in my code? Why it does not works? When I will click to button what contains this code, nothing happens. Main.cpp file is there and g++.exe too. Path is good.

You have to specify the path of source and object file.

string app = @"C:\Alps\compiler\H-i586-cygwin32\bin\g++.exe";
 string cppFile = @"-c c:\app\Main.cpp";
 string outFile = @"-o c:\app\main.o";

 System.Diagnostics.Process.Start(app, cppFile + " " + outFile);

Still does not works...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.