On 11/12/12 00:47, Pavel Sanda wrote: > Tommaso Cucinotta wrote: >> Don't know why I had to add "QtGui/" in a couple of includes in >> ColorCache.h. Different CPPFLAGS are provided for the objects in graphics/ >> and > > What Qt version do you use, what build system (autotools/cmake, merged build?)
I use autogen.sh, configure, and GNU make, on Ubuntu 12.10 as from up-to-date repo, with libqt4-dev 4:4.8.3+dfsg-0ubuntu3. >From config.status: ac_cs_config="'--prefix=/usr/local/lyx-trunk' '--with-version-suffix=-trunk' '--enable-build-type=dev' '--with-included-boost'" ac_cs_version="\ LyX config.status 2.1.0dev configured by ./configure, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" > There is couple of other files using the same includes in qt4/. Those compile > for you? Yes, everything compiles fine. Also ColorCache.h was not giving any trouble, till I included it in graphics/PreviewLoader.cpp, because then gcc complained it cannot find QColor nor QPalette (and I had to add the QtGui/). Just to let you understand: I'm touching a random .cpp file in qt4, versus one in graphics/, to highlight difference in CPPFLAGS: The g++ line for the file in qt4/ has -I..../QtGui: g++ -DHAVE_CONFIG_H -I. -I../../.. -DQT_NO_STL -DQT_NO_KEYWORDS -DQT_NO_CAST_TO_ASCII -DQT_NO_STL -I../../../src -I../../../src/frontends -I../../../images -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I../../../boost -Wextra -Wall -g -O -MT ColorCache.o -MD -MP -MF .deps/ColorCache.Tpo -c -o ColorCache.o ColorCache.cpp whilst the one for the file in graphics/ doesn't: g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../boost -I/usr/include/hunspell -DQT_NO_STL -DQT_NO_KEYWORDS -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -Wextra -Wall -g -O -MT GraphicsCache.o -MD -MP -MF .deps/GraphicsCache.Tpo -c -o GraphicsCache.o `test -f 'graphics/GraphicsCache.cpp' || echo './'`graphics/GraphicsCache.cpp So, I just tried the attached patch, and it seems to fix the problem (now it adds QtGui also while compiling liblyxgraphics objects, and I can remove the QtGui/ part from ColorCache.h includes). make[2]: Entering directory `/home/tommaso/lyx-trunk-ws/lyx/src' g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../boost -I/usr/include/hunspell -DQT_NO_STL -DQT_NO_KEYWORDS -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -Wextra -Wall -g -O -MT PreviewLoader.o -MD -MP -MF .deps/PreviewLoader.Tpo -c -o PreviewLoader.o `test -f 'graphics/PreviewLoader.cpp' || echo './'`graphics/PreviewLoader.cpp Is this all ok to commit and push ? T.
diff --git a/src/Makefile.am b/src/Makefile.am index d3c52f5..e2298f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ include $(top_srcdir)/config/common.am DISTCLEANFILES += libintl.h AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS) -AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES) +AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_INCLUDES) if BUILD_CLIENT_SUBDIR CLIENT = client