Eclipse,QT和“C ++项目”:是可能吗? [英] Eclipse, QT and "C++ project": is it possible?

查看:282
本文介绍了Eclipse,QT和“C ++项目”:是可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要您的帮助:

我想使用Eclipse CDT和QT而不创建Qt gui项目。可能吗?如何将QT库包含到我的C ++项目中,以及如何调用qmake / make来编译程序?此类似问题没有不要帮我(

I want to use Eclipse CDT and QT without creating a "Qt gui project". Is it possible? How to include QT libraries to my C++ project, and how to call qmake/make to compile the program? This Similar question didn't help me(

我想使用'C ++项目'而不是QT Gui项目,因为在QT项目中有外部库索引的问题(< a href =https://stackoverflow.com/questions/7412498/dubious-error-messages-in-eclipse-cdt-while-build-succeeds>此问题)

I want to use 'C++ project' instead of 'QT Gui project' because there is an issue with external libraries indexing in the QT project (this problem)

谢谢你!
Nikolai。

Thank you a lot! Nikolai.

推荐答案

这样做很麻烦,我建议你不要这样做,我只是在小项目上尝试过。

Doing this is quite bothering, I suggest you don't do it. I've tried it only on small projects.

据我所知,你必须自己编写一个正确的Makefile(或安装CDT来创建它)通过包括Qt头文件所需的所有包含路径,然后您必须链接到项目所使用的所有Qt库。

As far as I know you'll have to write a correct Makefile yourself (or setup CDT to create it) by including all the include paths you need for Qt headers. Then you'll have to link to all the Qt libraries your project is using.

如果您使用Qt元对象系统,则必须在com之前运行moc打包和链接。moc生成您必须链接到其他来源的C ++源。如果你使用GNU make,而且我想你是,似乎可以自动化moc,在Makefile CDT中创建正确的指令。有关详细信息,请阅读以下信息: http:// doc .qt.io / qt-5 / moc.html#writing-make-rules-for-invoking

If you make use of the Qt meta-object system you'll have to run the moc before compiling and linking. The moc generates C++ sources that you'll have to link to the other sources. If you're using GNU make, and I guess you are, it seems to be possible to automate the moc writing the correct instructions in the Makefile CDT will create. For detailed information read this: http://doc.qt.io/qt-5/moc.html#writing-make-rules-for-invoking.

顺便说一下,不是吗可能为您使用Qt Creator?

By the way, isn't it possible for you to use Qt Creator?

这篇关于Eclipse,QT和“C ++项目”:是可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆