enable-final broken in kdelibs (redefinition of `const int XKeyPress')

David Faure david at mandrakesoft.com
Thu Oct 17 21:19:01 BST 2002

Hash: SHA1

On Thursday 17 October 2002 22:14, Ellis Whitehead wrote:
> On Thursday 17 October 2002 18:22, Raffaele Sandrini wrote:
> > In file included from libkdecore_la.all_cpp.cpp:31:
> > kaccel.cpp:30: redefinition of `const int XKeyPress'
> > kapplication.cpp:118: `const int XKeyPress' previously defined here
> > kaccel.cpp:30: `KeyPress' was not declared in this scope
> > In file included from libkdecore_la.all_cpp.cpp:32:
> > kglobalaccel_x11.cpp: In method `bool KGlobalAccelPrivate::x11Event(_XEvent
> > *)':kglobalaccel_x11.cpp:183: case label `XKeyPress' does not reduce to an
> > integer constant
> Could someone explain to me what's happening here?
> What's the best way to check if a specific library (i.e., libkdecore) links 
> with --enable-final on

#ifdef KDE_FINAL

> when the rest of the project is without?

? Doesn't matter

> Would it work to change 'const int XKeyPress' to 'static const int XKeyPress' 
> or should it be '#define XKeyPress KeyPress' instead?

In both cases, the same _all.cpp file would have twice, which you don't want.
Ah, you could use #ifndef with the latter solution, though.

> Why is KeyPress listed as not declared in scope, when X.h was (via Xlib.h) 
> included just 2 lines earlier?

Maybe there's a #define already in another .cpp file?

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
Version: GnuPG v1.0.7 (GNU/Linux)


More information about the kde-core-devel mailing list