Eclipse中尚未解决的Qt包含问题 [英] Unresolved inclusion of Qt in Eclipse
问题描述
Eclipse无法找到Qt包含.同样,它无法为Qt类提供自动完成功能.
Eclipse fails to locate Qt includes. Likewise, it fails to provide auto-complete functionality for Qt classes.
我做了项目->属性->路径和符号->包含->添加到/usr/include/qt4/
中Qt的包含目录中.这导致Eclipse识别某些特定的类,例如QString
;.但是,没有自动完成功能.
I did Project -> Properties -> Paths and Symbols -> Includes -> Add to the include directories of Qt in /usr/include/qt4/
. This caused Eclipse to recognize certain certain classes such as QString
; however, there is no auto-complete.
我在网上搜索无济于事.如何使Eclipse将Qt索引到我的项目中?
I have scoured the web to no avail. How do I make Eclipse index Qt into my project?
12/20/12
我已经解决了自己的问题.出现包含事项的顺序.我放
I have solved my own problem. It appears order of the includes matter. I put
'usr/include/qt4'
'usr/include/qt4/Qt'
'usr/include/qt4/QtCore'
'usr/include/qt4/QtGui'
转换为Project Properties -> C++ General -> Paths & Symbols
.我重建并自动完成工作.
into Project Properties -> C++ General -> Paths & Symbols
. I rebuilt and the auto-complete worked.
推荐答案
您需要添加几个包含目录,例如,命令
You need to add several include directories, those listed by e.g. the command
pkg-config --cflags QtGui QtXml QtSvg QtDBus
(和其他Qt软件包).
(and others Qt packages).
这篇关于Eclipse中尚未解决的Qt包含问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!