Version: 1.6.0 (using KDE KDE 3.5.5) Installed from: Compiled From Sources Compiler: gcc 4.0.3 OS: Solaris I get the following when trying to compile KOffice 1.6.0: /usr/include/X11/Xutil.h:117: error: 'Bool' does not name a type /usr/include/X11/Xutil.h:120: error: 'Pixmap' does not name a type /usr/include/X11/Xutil.h:121: error: 'Window' does not name a type /usr/include/X11/Xutil.h:123: error: 'Pixmap' does not name a type /usr/include/X11/Xutil.h:124: error: 'XID' does not name a type /usr/include/X11/Xutil.h:207: error: 'XPointer' does not name a type /usr/include/X11/Xutil.h:254: error: expected ';' before '*' token /usr/include/X11/Xutil.h:255: error: 'VisualID' does not name a type /usr/include/X11/Xutil.h:287: error: 'Colormap' does not name a type /usr/include/X11/Xutil.h:295: error: 'VisualID' does not name a type /usr/include/X11/Xutil.h:296: error: 'XID' does not name a type /usr/include/X11/Xutil.h:332: error: expected constructor, destructor, or type c onversion before 'extern' /usr/include/X11/Xutil.h:417: error: 'Status' does not name a type /usr/include/X11/Xutil.h:425: error: 'Status' does not name a type /usr/include/X11/Xutil.h:434: error: 'Status' does not name a type /usr/include/X11/Xutil.h:442: error: 'Status' does not name a type /usr/include/X11/Xutil.h:452: error: 'Status' does not name a type /usr/include/X11/Xutil.h:461: error: 'Status' does not name a type /usr/include/X11/Xutil.h:470: error: 'Status' does not name a type /usr/include/X11/Xutil.h:488: error: 'Status' does not name a type /usr/include/X11/Xutil.h:503: error: 'Status' does not name a type /usr/include/X11/Xutil.h:511: error: 'Status' does not name a type /usr/include/X11/Xutil.h:519: error: 'Status' does not name a type /usr/include/X11/Xutil.h:528: error: 'Status' does not name a type /usr/include/X11/Xutil.h:538: error: 'Status' does not name a type /usr/include/X11/Xutil.h:572: error: 'Status' does not name a type /usr/include/X11/Xutil.h:590: error: 'Bool' does not name a type /usr/include/X11/Xutil.h:801: error: 'Status' does not name a type /usr/include/X11/Xutil.h:843: error: 'Status' does not name a type /usr/local/lib/kde-3.5/include/fixx11h.h:31: error: expected constructor, destru ctor, or type conversion before 'namespace' /usr/local/lib/kde-3.5/include/fixx11h.h:233: error: 'X' is not a namespace-name /usr/local/lib/kde-3.5/include/fixx11h.h:233: error: expected namespace-name bef ore ';' token KPrView.cpp: In function 'void enableDPMS(bool)': KPrView.cpp:216: error: 'DPMSQueryExtension' was not declared in this scope KPrView.cpp:217: error: 'DPMSCapable' was not declared in this scope KPrView.cpp:220: error: 'DPMSEnable' was not declared in this scope KPrView.cpp:223: error: 'DPMSDisable' was not declared in this scope KPrView.cpp:228: error: 'XFlush' was not declared in this scope KPrView.cpp: In function 'bool isDPMSEnabled()': KPrView.cpp:240: error: 'CARD16' was not declared in this scope KPrView.cpp:240: error: expected `;' before 'x_standby' KPrView.cpp:241: error: expected `;' before 'x_suspend' KPrView.cpp:242: error: expected `;' before 'x_off' KPrView.cpp:244: error: 'DPMSQueryExtension' was not declared in this scope KPrView.cpp:245: error: 'DPMSCapable' was not declared in this scope KPrView.cpp:246: error: 'x_standby' was not declared in this scope KPrView.cpp:246: error: 'x_suspend' was not declared in this scope KPrView.cpp:246: error: 'x_off' was not declared in this scope KPrView.cpp:246: error: 'DPMSGetTimeouts' was not declared in this scope In file included from KPrView.h:25, from KPrMSPresentationSetup.cpp:27: ../config.h:313:1: warning: "_FILE_OFFSET_BITS" redefined In file included from /usr/include/iso/string_iso.h:31, from /usr/local/lib/gcc/lib/gcc/sparc-sun-solaris2.8/4.0.3/incl ude/string.h:27, from /usr/local/lib/qt-3.3/include/qcstring.h:46, from /usr/local/lib/qt-3.3/include/qstring.h:42, from /usr/local/lib/qt-3.3/include/qwindowdefs.h:44, from /usr/local/lib/qt-3.3/include/qwidget.h:42, from /usr/local/lib/qt-3.3/include/qdialog.h:42, from /usr/local/lib/qt-3.3/include/qwizard.h:43, from /usr/local/lib/kde-3.5/include/kwizard.h:26, from KPrMSPresentationSetup.h:26, from KPrMSPresentationSetup.cpp:25: /usr/local/lib/gcc/lib/gcc/sparc-sun-solaris2.8/4.0.3/include/sys/feature_tests. h:105:1: warning: this is the location of the previous definition gmake[3]: *** [KPrView.lo] Error 1 gmake[3]: *** Waiting for unfinished jobs.... gmake[3]: Leaving directory `/software/work/packages/BUILD/koffice-1.6.0/kpresen ter' Last known version to compile without errors is KOffice 1.5.2.
Is that really the first error? /usr/include/X11/Xutil.h:117: error: 'Bool' does not name a type This is surprising... Does this help? --- KPrView.cpp (revision 596147) +++ KPrView.cpp (working copy) @@ -203,6 +203,7 @@ static const char * const pagedown_xpm[] }; #ifdef HAVE_DPMS +#include <fixx11h.h> #include <X11/Xutil.h> #include <X11/extensions/dpms.h> #include <fixx11h.h>
First error: Yes. Does the patch help: No. BUT this is a line from the start of Solaris' Xutil.h: /* You must include <X11/Xlib.h> before including this file */ Sounds familiar... I remember having suffered from that in the past. Now inserting #include <X11/Xlib.h> before #include <X11/Xutil.h> makes the first bunch of error disappear; the new first error line is: KPrView.cpp: In function 'void enableDPMS(bool)': So, please check if including Xlib.h needs a check for other platforms or if it can be included in all cases. After that we'll have to deal with the next set of errors.
On Tuesday 17 October 2006 22:04, Jens Hatlak wrote: > /* You must include <X11/Xlib.h> before including this file */ Ah! > Now inserting > #include <X11/Xlib.h> > before > #include <X11/Xutil.h> OK that makes sense. It's done that way in kdebase files, so it's fine to add it. > makes the first bunch of error disappear; the new first error line is: > KPrView.cpp: In function 'void enableDPMS(bool)': And what's the line below that?
Concerning the next few lines, see my initial comment, about half way through: KPrView.cpp: In function 'void enableDPMS(bool)': KPrView.cpp:216: error: 'DPMSQueryExtension' was not declared in this scope KPrView.cpp:217: error: 'DPMSCapable' was not declared in this scope KPrView.cpp:220: error: 'DPMSEnable' was not declared in this scope KPrView.cpp:223: error: 'DPMSDisable' was not declared in this scope KPrView.cpp:228: error: 'XFlush' was not declared in this scope KPrView.cpp: In function 'bool isDPMSEnabled()': KPrView.cpp:240: error: 'CARD16' was not declared in this scope KPrView.cpp:240: error: expected `;' before 'x_standby' KPrView.cpp:241: error: expected `;' before 'x_suspend' KPrView.cpp:242: error: expected `;' before 'x_off' KPrView.cpp:244: error: 'DPMSQueryExtension' was not declared in this scope KPrView.cpp:245: error: 'DPMSCapable' was not declared in this scope KPrView.cpp:246: error: 'x_standby' was not declared in this scope KPrView.cpp:246: error: 'x_suspend' was not declared in this scope KPrView.cpp:246: error: 'x_off' was not declared in this scope KPrView.cpp:246: error: 'DPMSGetTimeouts' was not declared in this scope
On Wednesday 18 October 2006 00:08, Jens Hatlak wrote: > KPrView.cpp:216: error: 'DPMSQueryExtension' was not declared in this scope Is that not defined in X11/extensions/dpms.h?
No, this is all the contents of that file on my machine (leaving out comments): #define DPMSModeOn 0 #define DPMSModeStandby 1 #define DPMSModeSuspend 2 #define DPMSModeOff 3
OK then HAVE_DPMS should not be set for you. The bug is in the configure check. Can you check that HAVE_DPMS is defined in koffice/config.h - but not in kdebase/config.h , if you also compiled kdebase? Otherwise you would have gotten similar problems in kdebase... The code for the configure check is in koffice/kpresenter/configure.in.in The test program tries to link a program that uses DPMSSetTimeouts.... Hmm, maybe you do have the DPMS stuff but in another header? X11/Xproto.h maybe?
There are some further defines in X11/extensions/dpmsstr.h (like X_DPMSCapable), but those listed in the error output from the previous comments, like DPMSQueryExtension, are nowhere to be found in /usr/include. Unlike koffice, kdebase also checks for DPMSCapable and DPMSInfo: configure:42622: checking for DPMS configure:42662: gcc -o conftest -O2 -I/usr/openwin/include -DQT_THREAD_SUPPO RT -I/usr/local/include -I/usr/openwin/include -D_REENTRANT -D_POSIX_PTHREAD_SEM ANTICS -DUSE_SOLARIS -DSVR4 -L/usr/local/lib/qt-3.3/lib-g++3 -R/usr/local/lib/qt -3.3/lib-g++3 -L/usr/openwin/lib -R/usr/openwin/lib -L/usr/local/lib -R/usr/loca l/lib -L/usr/local/lib/kde-3.5/lib -L/usr/local/lib/qt-3.3/lib -L/usr/openwin/l ib conftest.c -lX11 -lXext -lsocket -lnsl >&5 configure:42668: $? = 0 configure:42672: test -z || test ! -s conftest.err configure:42675: $? = 0 configure:42678: test -s conftest configure:42681: $? = 0 configure:42780: result: yes configure:42790: checking whether DPMSCapable is declared configure:42816: gcc -c -O2 -I/usr/openwin/include -DQT_THREAD_SUPPORT -I/usr /local/include -I/usr/openwin/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D USE_SOLARIS -DSVR4 conftest.c >&5 conftest.c: In function 'main': conftest.c:135: error: 'DPMSCapable' undeclared (first use in this function) conftest.c:135: error: (Each undeclared identifier is reported only once conftest.c:135: error: for each function it appears in.) configure:42822: $? = 1 configure: failed program was: ... configure:42846: result: no configure:42857: checking whether DPMSInfo is declared configure:42883: gcc -c -O2 -I/usr/openwin/include -DQT_THREAD_SUPPORT -I/usr /local/include -I/usr/openwin/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D USE_SOLARIS -DSVR4 conftest.c >&5 conftest.c: In function 'main': conftest.c:135: error: 'DPMSInfo' undeclared (first use in this function) conftest.c:135: error: (Each undeclared identifier is reported only once conftest.c:135: error: for each function it appears in.) configure:42889: $? = 1 configure: failed program was: ... configure:42913: result: no
On Wednesday 18 October 2006 12:18, Jens Hatlak wrote: > There are some further defines in X11/extensions/dpmsstr.h (like X_DPMSCapable), but those listed in the error output from the previous comments, like DPMSQueryExtension, are nowhere to be found in /usr/include. > > Unlike koffice, kdebase also checks for DPMSCapable and DPMSInfo: Hmm, that's weird, the acinclude.m4.in code for AC_HAVE_DPMS is where the checks for DPMSCapable and DPMSInfo come from, so it should be done just the same in koffice and in kdebase. Do you have DPMSSetTimeouts anywhere? What does configure say after "checking for DPMS..."? What's in koffice's config.log about the dpms check?
"the acinclude.m4.in code for AC_HAVE_DPMS is where the checks for DPMSCapable and DPMSInfo come from, so it should be done just the same in koffice and in kdebase" Actually, it is the same (same output as in my last comment). I just forgot to check the koffice config.log. DPMSSetTimeouts is not defined anywhere, only X_DPMSSetTimeouts (in X11/extensions/dpmsstr.h). I checked kdebase-3.5.5/kcontrol/energy/energy.cpp and found that it includes the following lines: #ifdef HAVE_DPMS #include <X11/Xmd.h> extern "C" { #include <X11/extensions/dpms.h> Status DPMSInfo ( Display *, CARD16 *, BOOL * ); Bool DPMSCapable( Display * ); int __kde_do_not_unload = 1; #ifndef HAVE_DPMSCAPABLE_PROTO Bool DPMSCapable ( Display * ); #endif #ifndef HAVE_DPMSINFO_PROTO Status DPMSInfo ( Display *, CARD16 *, BOOL * ); #endif } #if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux) extern "C" { #endif Bool DPMSQueryExtension(Display *, int *, int *); Status DPMSEnable(Display *); Status DPMSDisable(Display *); Bool DPMSGetTimeouts(Display *, CARD16 *, CARD16 *, CARD16 *); Bool DPMSSetTimeouts(Display *, CARD16, CARD16, CARD16); #if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux) } #endif #endif Since it compiles here, I guess that's the way to go.
I see. Does this patch work? Created an attachment (id=18175) [details] KPrView.cpp.diff
No, you also have to port #include <X11/Xmd.h> from the kdebase solution. Without it I get the following: KPrView.cpp:222: error: 'CARD16' has not been declared KPrView.cpp:222: error: 'CARD16' has not been declared KPrView.cpp:222: error: 'CARD16' has not been declared KPrView.cpp: In function 'bool isDPMSEnabled()': KPrView.cpp:258: error: 'CARD16' was not declared in this scope KPrView.cpp:258: error: expected `;' before 'x_standby' KPrView.cpp:259: error: expected `;' before 'x_suspend' KPrView.cpp:260: error: expected `;' before 'x_off' KPrView.cpp:264: error: 'x_standby' was not declared in this scope KPrView.cpp:264: error: 'x_suspend' was not declared in this scope KPrView.cpp:264: error: 'x_off' was not declared in this scope CARD16 is defined in X11/Xmd.h -> needs to be included. Otherwise, it compiles now. :-)
SVN commit 596812 by dfaure: Fix compilation on Solaris - thanks to Jens Hatlak for his tests and feedback BUG: 135830 M +19 -0 KPrView.cpp --- branches/koffice/1.6/koffice/kpresenter/KPrView.cpp #596811:596812 @@ -203,11 +203,30 @@ }; #ifdef HAVE_DPMS +#include <X11/Xlib.h> #include <X11/Xutil.h> +#include <X11/Xmd.h> #include <X11/extensions/dpms.h> #include <fixx11h.h> + +extern "C" { +#ifndef HAVE_DPMSCAPABLE_PROTO +Bool DPMSCapable( Display * ); #endif +} +#if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux) +extern "C" { +#endif + Bool DPMSQueryExtension(Display *, int *, int *); + Status DPMSEnable(Display *); + Status DPMSDisable(Display *); + Bool DPMSGetTimeouts(Display *, CARD16 *, CARD16 *, CARD16 *); +#if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux) +} +#endif +#endif + static void enableDPMS(bool enable) { #ifdef HAVE_DPMS
Patch confirmed working on Solaris 8/Sparc + gcc-3.4.6, thx
You need to log in before you can comment on or make changes to this bug.