K
K
Kirixo2019-12-02 16:52:24
Qt
Kirixo, 2019-12-02 16:52:24

How to embed c++ compiler in Qt application?

how to embed c++ compiler in a GUI project in qt? I want the user, having written some code in the text area, to be able to click on some compilation button, and so that in the modal window or somewhere else (it doesn’t matter) it would be possible to enter data in the console and receive a response. That is, I want, for example, to embed some kind of mingw or something else and send it the text received from "my console" and receive in response everything that is usually displayed in the console. Please help it is very necessary.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2019-12-02
@Kirixo

Well, just throw the mingw binary into the folder with your program and send commands to it to compile via system ().
Something like:
1. Read code from textarea;
2. Save it to a file;
3. Feed to the compiler;
4. If there are no errors, then run with standard output to the same file (if you do not master the streams);
5. Read the file and output to the user;
6. If there are errors, then display them to the user.

V
vanyamba-electronics, 2019-12-02
@vanyamba-electronics

I advise you to google man fork .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question