Build failure: _XDisplay internals not visible
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I'm building head of CVS as of this morning, on cygwin under Windows XP. I have xorg X11 packages installed:
cygcheck -c xorg-x11-devel Cygwin Package Information Package Version Status xorg-x11-devel 6.8.99.901-1 OK
I configured with Tcl wrapping ON, and the build fails as follows:
[ 71%] Building CXX object Rendering/CMakeFiles/vtkRenderingTCL.dir/vtkTkRenderWidget.o
/tmp/local-build/VTK-cvs/Rendering/vtkTkRenderWidget.cxx: In function LRESULT vtkTkRenderWidgetProc(HWND__*, UINT, WPARAM, LPARAM)': /tmp/local-build/VTK-cvs/Rendering/vtkTkRenderWidget.cxx:836: error: invalid use of undefined type
struct _XDisplay'
/usr/include/X11/Xlib.h:289: error: forward declaration of `struct _XDisplay'
make[2]: *** [Rendering/CMakeFiles/vtkRenderingTCL.dir/vtkTkRenderWidget.o] Error 1
make[1]: *** [Rendering/CMakeFiles/vtkRenderingTCL.dir/all] Error 2
make: *** [all] Error 2
In the xorg header file X11/Xlib.h, we find:
/*
- Display datatype maintaining display specific data.
- The contents of this structure are implementation dependent.
- A Display should be treated as opaque by application code. */ #ifndef XLIB_ILLEGAL_ACCESS typedef struct _XDisplay Display; #endif
[...]
typedef struct #ifdef XLIB_ILLEGAL_ACCESS _XDisplay #endif { [...]
So: you can only access internals of _XDisplay if XLIB_ILLEGAL_ACCESS is defined.
I defined that symbol and the build is proceeding. Perhaps the better solution is to see about getting the information required without poking around into X11 internals. I didn't attempt to do that.