简体   繁体   English

在Qt中设计IDE; 有没有可以使用的编译器包?

[英]Designing IDE in Qt; is there an already made compiler package I could use?

I am designing a simple IDE just as a side project. 我正在将一个简单的IDE设计为一个附带项目。

I don't want to design a compiler for something that is just a side project that I will only be working on ever once in awhile. 我不想为只是一个附带项目的编译器而设计,而我只会偶尔进行一次。

So, is there some sort of pre-made, open source package I could use and link with my IDE? 那么,是否有我可以使用并链接到IDE的某种预制的开源软件包?

Right now all I care about compiling is c and c++ but I want to add support for other languages (Java, C#, Perl, etc...) at some point, if I'm still working on the project. 现在,我只关心c和c ++,但是如果我仍在从事该项目,我想在某个时候添加对其他语言(Java,C#,Perl等)的支持。

Thanks. 谢谢。 Again, just to clarify, I am looking for ac/c++ compiler(compilers for other languages would also help) to link with my Qt made IDE project to compile the code written in my application. 同样,为了澄清起见,我正在寻找ac / c ++编译器(其他语言的编译器也会有帮助)与我的Qt made IDE项目链接,以编译在我的应用程序中编写的代码。

您只需要调用命令行GCC并捕获输出(stdout)即可在您的应用程序窗口中显示。

It is simply a matter of invoking the desired compiler as an external process. 只需将所需的编译器作为外部过程调用即可。 You will need to pass the correct command line arguments, and presumably capture the output of the compiler and display it to the user in the GUI. 您将需要传递正确的命令行参数,并大概捕获编译器的输出并在GUI中将其显示给用户。

Since you are using Qt, I would suggest looking at QProcess . 由于您使用的是Qt,因此建议您查看QProcess QProcess provides a simple and platform-neutral way of invoking a process and communicating with it. QProcess提供了一种简单且与平台无关的方式来调用流程并与之通信。

Apart from that, all you need is a way of generating the correct command line arguments for each compiler you wish to integrate with your IDE. 除此之外,您所需要做的就是为要与IDE集成的每个编译器生成正确的命令行参数的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM