[Rd] Problems in rgl on MacOS X
Bill Northcott
w.northcott at unsw.edu.au
Wed Jul 20 01:25:36 CEST 2005
I have recently been trying to build rgl on MacOS X 10.4 using
R-2.1.1 with gcc-4.0 5026 and gfortran.
The R binary I built without problems and it includes libpng and Tcl/
Tk on X11. Rcmdr works correctly.
The rgl build produces a large number of warnings like:
g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/
include -I/System/Library/Frameworks/OpenGL.framework/Headers -I/usr/
X11R6/include -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/usr/
local/include -Wall -pedantic -fno-exceptions -fno-rtti -fno-common
-g -O2 -c fps.cpp -o fps.o
types.h:76: warning: 'class DestroyHandler' has virtual functions but
non-virtual destructor
gui.h:55: warning: 'class gui::WindowImpl' has virtual functions but
non-virtual destructor
gui.h:89: warning: 'class gui::GUIFactory' has virtual functions but
non-virtual destructor
pixmap.h:39: warning: 'class PixmapFormat' has virtual functions but
non-virtual destructor
More seriously it breaks in scene.cpp thus:
g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/
include -I/System/Library/Frameworks/OpenGL.framework/Headers -I/usr/
X11R6/include -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/usr/
local/include -Wall -pedantic -fno-exceptions -fno-rtti -fno-common
-g -O2 -c scene.cpp -o scene.o
types.h:76: warning: 'class DestroyHandler' has virtual functions but
non-virtual destructor
gui.h:55: warning: 'class gui::WindowImpl' has virtual functions but
non-virtual destructor
gui.h:89: warning: 'class gui::GUIFactory' has virtual functions but
non-virtual destructor
pixmap.h:39: warning: 'class PixmapFormat' has virtual functions but
non-virtual destructor
scene.cpp: In member function 'void Texture::beginUse(RenderContext*)':
scene.cpp:1994: error: invalid conversion from 'int*' to 'GLint*'
make: *** [scene.o] Error 1
ERROR: compilation failed for package 'rgl'
The compilers complaint appears to be legitimate in gl.h there is:
......
typedef short GLshort;
typedef long GLint;
typedef long GLsizei;
........
extern void glGetHistogramParameteriv (GLenum target, GLenum pname,
GLint *params);
extern void glGetIntegerv (GLenum pname, GLint *params);
extern void glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
.............
and in scene.cpp the relevant lines read:
..........
unsigned int maxSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (int*) &maxSize);
.......
which seems to give the compiler due cause to barf given the header.
I got it to build by changing the code to:
GLint maxSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &maxSize);
but this generates warnings about signed and unsigned further down
scene.cpp. The resulting code works but it is clearly not right.
I can't find an email address for the maintainer and his web site
seems to be off the air just now.
Bill Northcott
More information about the R-devel
mailing list