Unresolved inclusion of Qt in Eclipse

喜夏-厌秋 提交于 2019-12-06 04:04:43

问题


Eclipse fails to locate Qt includes. Likewise, it fails to provide auto-complete functionality for Qt classes.

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.

I have scoured the web to no avail. How do I make Eclipse index Qt into my project?

Edit: 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'

into Project Properties -> C++ General -> Paths & Symbols. I rebuilt and the auto-complete worked.


回答1:


You need to add several include directories, those listed by e.g. the command

 pkg-config --cflags QtGui QtXml QtSvg QtDBus

(and others Qt packages).



来源:https://stackoverflow.com/questions/13927730/unresolved-inclusion-of-qt-in-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!