0

I am building an app that would compile C programs and display the results on a Windows Platform.

The standard C compiler for Windows is MinGW.

Is there any API for MinGW in Java or C# and how do I call the compiler?

I have referred these links: Calling C compiler from java program and C program compilation from a java program.

Community
  • 1
  • 1
xxx
  • 179
  • 2
  • 12
  • Unclear what you are looking for outside of what shown in [C program compilation from JAva](http://stackoverflow.com/questions/20463523/c-program-compilation-from-a-java-program) link you've provided... Can you clarify what you expect to find except "start a Process" APIs in Java/C#? – Alexei Levenkov Nov 07 '14 at 16:04
  • If I have to compile my program then I need to install mingw but without installing just with the api call can it be done? – xxx Nov 07 '14 at 16:07

2 Answers2

0

MinGW has not an API by itself if what you are thinking about is a library. The only viable approach is to launch the compiler as a process. The links you have referred explain how to, just follow them.

feryllt
  • 66
  • 5
0

There is no C/C++ compiler on Windows and unlikely to have cross-compiler installed by default on *nux platforms - so bring you own.

And there is no "API" that magically compiles C code either.

Note that both Java and C#/.Net have compiler services for its own languages - you may want to think about using C# instead of C. And as long as you have .Net Framework on Windows you get csc.exe compiler if you need to compile from command line.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179