c++ - codelite 5.1 cannot find <QString> -
using codelite 5.1 on ubuntu 12.10:
created minimal qtgui app. built , ran fine.
#include <qapplication> #include <qbutton>
were inserted wizard in main.cpp file - no problem. added:
#include <qstring>
as per qt docs, , pre-processer tells me can't find qstring. checked include setting projects -
../qt4
and
../qt4/qt4gui
are there correctly. tried:
#include <qt4/qstring>
with different case permutations - no go.
what's wrong? (posting on codelite forum).
while qapplication
, qbutton
part of qt gui module, qstring
part of qt core module. gui depends on core, core library linked, that's not problem.
the problem seems include path includes qt top level gui sub-directory. qt's header files structured in modules, 1 directory each module. means <qapplication>
, <qbutton>
headers in ../qt4/qt4gui
, can found compiler.
however, qstring
placed in ../qt4/qt4core
(1) , has either included #include <qtcore/qstring>
(2) in correct module sub-directory, or adding sub-directory include paths in project configuration (recommended), #include <qstring>
works too.
(1) think should ../qt4/qtcore
, , qt gui ../qt4/qtgui
, wrote different in question...
(2) iternally in qt, classes of other modules included this, i.e. relative qt top level include path, if include class uses qstring
(qapplication
being 1 example), it's working without adding include.
Comments
Post a Comment