[kde-freebsd] A bug in QtCore.pc or qglobal.h?
Jeremy Messenger
mezz7 at cox.net
Sat Jun 21 18:20:38 CEST 2008
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
--
mezz7 at cox.net - mezz at FreeBSD.org
FreeBSD GNOME Team
http://www.FreeBSD.org/gnome/ - gnome at FreeBSD.org
More information about the kde-freebsd
mailing list