且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Eclipse中设置QT路径,而不使用“Qt项目”?

更新时间:2022-10-30 16:17:43

很好,你提供的Qt包含路径看起来怀疑我。你真的有一个目录在你的根名为'include'??大多数不会。



此外,通常QtGui在内的Qt包含目录,你有其他人像QtCore等。 / p>

但是就Eclipse中的设置而言,你是在正确的路径。


I have a mixed C++/Qt/Python project managed in Eclipse, and I would like to set the Qt paths without setting my project as a "Qt Project".

Using CDT and setting it as general "Makefile project from existing code", I cannot find any option in the project properties, where I can set the Qt paths. The menu "QT" seems to disappear from the project Properties if the project is set as other than "Qt Project".

I set the Qt include path (e.g. /include/QtGui/) in the "C++ General --> Paths & Symbols" option, but the includes (e.g. #include ) are still marked as "unresolved" by Eclipse.

Could you help me setting the Qt paths in the right way?

UPDATE

I ended up setting the project as "Qt GUI Project", then removing all files the Qt plugin created for me, and then adding all my C++ include paths in the build configuration.

It worked, but unfortunately the "Qt Gui Project" lacks of nice features you can find in the standard CDT "C++ project" as importing configurations from other projects, and so on...

so I still would like to hear from you, if you have hints to set a clean C++ project which makes use of Qt classes.

Well, the Qt include path you're supplying looks suspect to me. Do you really have a directory on your root called 'include'?? Most don't.

Also, usually QtGui is within the Qt include directory, where you've got others like QtCore and such.

But as far as settings in Eclipse go, you're on the right path.