Bug 125979 - /usr/include/X11/extensions/dpms.h cannot be used in C++ code
/usr/include/X11/extensions/dpms.h cannot be used in C++ code
Product: Fedora
Classification: Fedora
Component: XFree86 (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Mike A. Harris
Depends On:
  Show dependency treegraph
Reported: 2004-06-14 15:03 EDT by Kevin DeKorte
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-07-07 03:16:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kevin DeKorte 2004-06-14 15:03:15 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040612 Firefox/0.8

Description of problem:
When using dpms.h in a C++ program. The code is compiled and linked
correctly, but when the program is ran the DPMS symbols have been
mangled by C++ and the DPMS* functions can't be located and the
program crashes. Suggest putting and #ifdef __cplusplus extern "C" in
the dpms.h header to correct this problem.

Example from xpm.h, which works correctly with C++

#ifdef __cplusplus
extern "C" {

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create a c++ program that uses DPMSQueryExtension
2. compile and link program
3. execute program

Actual Results:   relocation error: 
undefined symbol: _Z18DPMSQueryExtensionP9_XDisplayPiS1_

Expected Results:  Program should execute correctly.

Additional info:

When compiling against C code the program works correctly.

In my program I did this and it solved the problem

#ifdef DPMSExtension
#include <X11/Xlib.h>

#include <X11/X.h>
#include <X11/Xmd.h>

extern "C" Bool DPMSQueryExtension(Display *, int *, int *);
extern "C" Bool DPMSCapable(Display *);
extern "C" Status DPMSInfo(Display *, CARD16 *, BOOL *);
extern "C" Status DPMSEnable(Display *);
Comment 1 Mike A. Harris 2004-07-05 20:46:36 EDT
I don't want to make such a change to our X header files unless
it's been approved by upstream first, as there are risks involved
within a stable release cycle, however if you file a bug report
in the X.Org bugzilla at http://bugs.freedesktop.org and
carbon copy me on the bug report, I'll track the issue in their
bugzilla instead, and will consider backporting any changes they
make in CVS.

Thanks for the report!
Comment 2 Kevin DeKorte 2004-07-06 11:48:32 EDT
Opened bug #830 at freedesktop 
Comment 3 Mike A. Harris 2004-07-07 03:16:56 EDT
Above link points to 830 in Red Hat bugzilla.

Upstream URL link is:

Setting bug status to "UPSTREAM" and tracking in fd.o bugzilla.

Comment 4 Mike A. Harris 2004-09-01 07:41:59 EDT
Status update:  The upstream bug report has not yet received any
comments from developers.  You may wish to discuss the issue with
them on xorg mailing lists, or update the upstream report with
additional comments.
Comment 5 Kevin DeKorte 2004-09-01 22:51:28 EDT
I have submitted at patch into the bugzilla report. Hopefully it will
be accepted.
Comment 6 Mike A. Harris 2006-07-21 17:44:12 EDT
Was committed to upstream CVS for a while now.  Resolving as rawhide...

Note You need to log in before you can comment on or make changes to this bug.