在Qt中设计IDE;有没有我可以使用的已经制作好的编译器包?
我正在设计一个简单的 IDE,只是作为一个业余项目。
我不想为一些我偶尔会做的副业项目设计一个编译器。
那么,是否有某种预制的开源包可供我使用并与我的 IDE 链接?
现在我只关心编译 c 和 c++,但我想在某个时候添加对其他语言(Java、C#、Perl 等)的支持,如果我仍在处理该项目的话。
谢谢。再次澄清一下,我正在寻找 ac/c++ 编译器(其他语言的编译器也有帮助)来链接我的 Qt 制作的 IDE 项目来编译我的应用程序中编写的代码。
I am designing a simple IDE just as a side project.
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?
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.
Thanks. Again, just to clarify, I am looking for a c/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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需要调用命令行 GCC 并捕获输出(stdout)即可显示在应用程序窗口中。
You just need to call command line GCC and capture output (stdout) to display in your application window.
只需将所需的编译器作为外部进程调用即可。您将需要传递正确的命令行参数,并且可能捕获编译器的输出并将其在 GUI 中显示给用户。
由于您使用的是 Qt,我建议您查看 QProcess。 QProcess 提供了一种简单且与平台无关的方法来调用进程并与之通信。
除此之外,您所需要的只是为您希望与 IDE 集成的每个编译器生成正确的命令行参数。
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.
Since you are using Qt, I would suggest looking at QProcess. QProcess provides a simple and platform-neutral way of invoking a process and communicating with it.
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.