[odb-users] Qt + Odb

Boris Kolpackov boris at codesynthesis.com
Thu Sep 8 07:43:02 EDT 2011

Hi Michal,

In the future please keep your replies CC'ed to the odb-users mailing
list as discussed in the posting guidelines:


Michal Snoch <kontakt at msnoch.pl> writes:

> I figured out that passing
> odb --profile qt --database pgsql test.cpp  
> -I/usr/local/Trolltech/Qt-4.7.3/include
> solves half of the problem. I can compile file, but i have to have 
> headers like this
> #include <Qt/qstring.h>
> But what should I do to be able to use normal <QString>? I think that is  
> gcc problem, not odb, but maybe you can help?

If you want to include QString as just <QString>, you will need to add:


In addition to:


In ODB source we include it as <QtCore/QString>, which seems to be
a more portable way even though the Qt documentation suggests that we
include it as <QString>. For example, for Mac OS X, Qt is built as a
framework. If you pass -framework QtCore to the compiler, you only
get the path to the include/ directory, not to include/QtCore/.


More information about the odb-users mailing list