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.

2
  • Unclear what you are looking for outside of what shown in C program compilation from JAva link you've provided... Can you clarify what you expect to find except "start a Process" APIs in Java/C#? Commented Nov 7, 2014 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? Commented Nov 7, 2014 at 16:07

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Please see the comment in the question.
Do you want to compile a C program with MinGW from java without installing MinGW? If so I would say it is impossible.
Are there any other apis?
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.