Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [FIXED] X11 GLCtrl broken again ?
[FIXED] X11 GLCtrl broken again ? [message #28306] Thu, 26 August 2010 23:10 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Today (but it's about 2 weeks I don't try it...) GLCtrl don't compile anymore on my Ubuntu 10.04.
The problem is a 'typedef Status' inside GL/glx.h which clashes with Upp::Status.

I really wonder why those X11 + OpenGL people don't enclose their stuffs in a namespace.....

Max

Easy solution would be, in DrawX11.h :
#ifdef PLATFORM_X11

#define Time    XTime
#define Font    XFont
#define Display XDisplay
#define Picture XPicture

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>

#include <X11/Xft/Xft.h>
#include <X11/extensions/Xrender.h>

#include <GL/gl.h>       <--------
#include <GL/glu.h>      <-------- HERE
#include <GL/glx.h>      <--------

#undef Picture
#undef Time
#undef Font
#undef Display


But I guess we don't want opengl dependency if not used....

[Updated on: Mon, 30 August 2010 15:19]

Report message to a moderator

Re: X11 GLCtrl broken again ? [message #28308 is a reply to message #28306] Fri, 27 August 2010 00:14 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
A more viable workaround....

in GlCtrl.h :

#ifndef _GLCtrl_GLCtrl_h
#define _GLCtrl_GLCtrl_h

#include <CtrlLib/CtrlLib.h>

#include <GL/gl.h>
#include <GL/glu.h>

NAMESPACE_UPP

#ifdef PLATFORM_X11
	#define GLX_SUN_get_transparent_index   <----- HERE
	#include <GL/glx.h>
#endif


That one drops this part of glext.h :

#ifndef GLX_SUN_get_transparent_index
#define GLX_SUN_get_transparent_index 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#endif


I really don't know its purpose, but disabling it made GLCtrl compile again.

Mirek, it's an acceptable solution ? I didn't find a better one by now.

Ciao

Max
Re: X11 GLCtrl broken again ? [message #28349 is a reply to message #28308] Mon, 30 August 2010 11:16 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Mirek, here the compilation error :

In file included from /usr/include/GL/glx.h:336,
                 from /home/massimo/sources/upp-svn/uppsrc/GLCtrl/GLCtrl.h:12,
                 from /home/massimo/sources/upp-svn/MyApps/TestGL/TestOpenGL.cpp:1:
/usr/include/GL/glxext.h:714: error: typedef ‘Upp::Status’ is initialized (use decltype instead)
/usr/include/GL/glxext.h:714: error: ‘PFNGLXGETTRANSPARENTINDEXSUNPROC’ was not declared in this scope


The glext.h is included AFTER upp namespace opening because of your defines in X11 stuffs :
#ifndef _GLCtrl_GLCtrl_h
#define _GLCtrl_GLCtrl_h

#include <CtrlLib/CtrlLib.h>

#include <GL/gl.h>
#include <GL/glu.h>

NAMESPACE_UPP

#ifdef PLATFORM_X11
	#include <GL/glx.h>
#endif


If I include after I have tons of errors.
Now, with the #define we spoke about :

#ifdef PLATFORM_X11
	#define Status GLStatus
	#include <GL/glx.h>
	#undef Status
#endif


the error is almost the same :
In file included from /usr/include/GL/glx.h:336,
                 from /home/massimo/sources/upp-svn/uppsrc/GLCtrl/GLCtrl.h:13,
                 from /home/massimo/sources/upp-svn/uppsrc/GLCtrl/GLPicking.cpp:1,
                 from /home/massimo/sources/upp-svn/out/GLCtrl/GCC.Debug.Debug_full.Gui.Shared/$blitz.cpp:3:
/usr/include/GL/glxext.h:714: error: typedef ‘Upp::GLStatus’ is initialized (use decltype instead)
/usr/include/GL/glxext.h:714: error: ‘PFNGLXGETTRANSPARENTINDEXSUNPROC’ was not declared in this scope


The best would be of course include glext BEFORE upp namespace :

#ifdef PLATFORM_X11
	#define Status GLStatus
	#include <GL/glx.h>
	#undef Status
#endif

NAMESPACE_UPP


But then I get tons of errors because of your #defines in X11 core. If I replicate all those defines :

#ifdef PLATFORM_X11
	#define Time    XTime
	#define Font    XFont
	#define Display XDisplay
	#define Picture XPicture
	#define Status GLStatus
	#include <GL/gl.h>
	#include <GL/glu.h>
	#include <GL/glx.h>
	#undef Status
	#undef Picture
	#undef Time
	#undef Font
	#undef Display
#else
	#include <GL/gl.h>
	#include <GL/glu.h>
#endif


I get tons of errors, AND the same error as before at end.

Quite out of ideas ....

Max
Re: X11 GLCtrl broken again ? [message #28358 is a reply to message #28349] Mon, 30 August 2010 13:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
Fixed.

Mirek
Re: X11 GLCtrl broken again ? [message #28359 is a reply to message #28358] Mon, 30 August 2010 14:57 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
luzr wrote on Mon, 30 August 2010 13:57

Fixed.

Mirek


nope.....

In file included from /usr/include/GL/glx.h:336,
                 from /home/massimo/sources/upp-svn/uppsrc/GLCtrl/GLCtrl.h:15,
                 from /home/massimo/sources/upp-svn/MyApps/GLControlTest/main.cpp:2:
/usr/include/GL/glxext.h:714: error: typedef ‘Status’ is initialized (use decltype instead)
/usr/include/GL/glxext.h:714: error: ‘PFNGLXGETTRANSPARENTINDEXSUNPROC’ was not declared in this scope
GLControlTest: 1 file(s) built in (0:00.98), 983 msecs / file, duration = 3828 msecs, parallelization 100%


Which Ubuntu version do you have ? Did you latest updates ?

Max
Re: X11 GLCtrl broken again ? [message #28360 is a reply to message #28359] Mon, 30 August 2010 15:20 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Now it's perfect Smile

Thank you Mirek !

Max
Previous Topic: How about vfw.h, alibrary for video application in windows?
Next Topic: Web CGI
Goto Forum:
  


Current Time: Sun Sep 22 20:38:58 CEST 2019

Total time taken to generate the page: 0.01025 seconds