Tuesday, March 4, 2008

DGLWindow.cpp >> DGLWindow.o compilation error

I dug through the files. I can see that the Qt include files are getting
added, so the cmake stuff is probably OK.

Your build crashed on a compile, going from DGLWindow.cpp to DGLWindow.o, so
the libraries aren't involved, yet.

Looking at the error messages...

I looked at line 838 of qnamespace.h:
enum CursorShape {

I grepped through the Producer and OSG files and couldn't find a
CursorShape. Going through all of /usr/include got me a CursorShape in
/usr/include/X11/X.h:

#define CursorShape 0

so if the X11 file gets included before the qt include, the qt enum will become:
enum 0 {

clearly an error. I saw this comment in qevent.h, which had a similar error:
/*
If you get a strange compiler error on the line with None,
it's probably because you're also including X11 headers,
which #define the symbol None. Put the X11 includes after
the Qt includes to solve this problem.
*/

Another error:
qwindowdefs.h:147: error: reference to 'Display' is ambiguous
qwindowdefs.h:141: error: candidates are: typedef struct _XDisplay Display
Types:49: error: typedef struct Display Producer::Display

I think all the Display error complaints are because both X11 and Producer
define "Display". This has been a pain for me too. Probably the best thing
is rearrange the includes, as mentioned in the comment above, or just remove
the Producer code entirely.