[kde-freebsd] A bug in QtCore.pc or qglobal.h?

Max Brazhnikov makc at issp.ac.ru
Sat Jun 21 21:04:08 CEST 2008


On Sat, 21 Jun 2008 11:20:38 -0500, Jeremy Messenger wrote:
> Hello folks,
>
> I am wondering if there is a bug in QtCore.pc for not have
> -I/usr/local/include or qglobal.h for should be '#include
> <QtCore/qconfig.h>' -> '#include <qconfig.h>'? A simple test.cc failed to
> compile unless I add -I/usr/local/include.
>
> -------------------------------------
> # cat test.cc
> #include <cstdio>
> #include <QtGlobal>
> extern "C" int main(void)
> {
>    printf("found version %s", QT_VERSION_STR);
> #if QT_VERSION >= 0x040200
>    printf(", OK.\n");
>    return 0;
>    printf(", expected version 4.2.0 or higher\n");
>    return 1;
> #endif
> }
> -------------------------------------
>
> -------------------------------------
> # c++ -O -Wall -o test test.cc `pkg-config QtCore --cflags --libs`
> In file included from /usr/local/include/QtCore/QtGlobal:1,
>                   from test.cc:2:
> /usr/local/include/QtCore/qglobal.h:62:28: error: QtCore/qconfig.h: No
> such file or directory
> /usr/local/include/QtCore/qglobal.h:942:31: error: QtCore/qfeatures.h: No
> such file or directory
> /usr/local/include/QtCore/qglobal.h:1139:4: error: #error "Qt not
> configured correctly, please run configure"
> /usr/local/include/QtCore/qglobal.h:2036:6: error: #error "Qt not
> configured correctly, please run configure"
> -------------------------------------
>
> The solution is to add -I/usr/local/include.
>
> -------------------------------------
> # c++ -O -Wall -o test test.cc `pkg-config QtCore --cflags --libs`
> -I/usr/local/include
> # ./test
> found version 4.3.4, OK.
> -------------------------------------
>
> -------------------------------------
> # pkg-config QtCore --cflags --libs
> -DQT_SHARED -I/usr/local/include/QtCore  -pthread -L/usr/local/lib
> -lQtCore -lz -lm -lgthread-2.0 -lglib-2.0 -liconv
> -------------------------------------
>
> BTW: Please add me in CC.
>
> Cheers,
> Mezz
/usr/local/include was removed (incorrectly) from Qt*.pc. The problem is that 
qt3 installs headers (one of them is qconfig.h) to /usr/local/include  and 
this sometimes confuses qt4 ports.

Max




More information about the kde-freebsd mailing list