View Full Version : Using GLEE with Borland C++ Builder 6?

04-12-2010, 09:57 AM

Im quite new to using GL. I have managed to develop some simple applications in Borland Builder C++ 6, but i need to move forward to using some buffering functionality not supported in openGL 1.1 (i need at least to use OpenGL 2.1). I tried using GLEW with BB6, trying the simplest way:

glew32.dll to %SystemRoot%/system32
glew32.lib to {BCB6 Root}/Lib
glew.h to {BCB6 Root}/Include/GL
wglew.h to {BCB6 Root}/Include/GL

Then, i include in my program:

#include <GL\glew.h>

and get the following error when trying to compile:

[C++ Error] glew.h(156): E2238 Multiple declaration for 'ptrdiff_t'

The error is in this sector of glew.h:

#if !defined(_PTRDIFF_T_DEFINED) &amp;&amp; !defined(_PTRDIFF_T_)
# ifdef _WIN64
typedef __int64 ptrdiff_t;
# else
typedef _W64 int ptrdiff_t; <-THIS IS THE LINE WITH THE ERROR
# endif
# define _PTRDIFF_T_

Does anyone know if BCB6 supports Glew, or if there is any way of doing so? I searched the forum but couldnīt find anything related to GLEE in BCB6 forms applications.

Thanks in advance

04-13-2010, 05:17 AM

I used GLEW with Borland and it was really easy to start using it.I think you just have to arrange "includes of header files" properly.
BTW if you need it only for some extensions you can simply use the extension headers glext.h and wglext.h (supplied by OpenGL.org) without GLEW or GLEE.After I got used to it I found GLEW unnecessary, at least for my current project.

04-14-2010, 05:15 AM
Thank you very much!

Iīm using glext.h and wglext.h and doing perfectly for this project.

I'll leave my solution here (may help someone else) for a simple example:

I needed to use glBlendColor(red,green,blue,alpha) supported in openg1.2

I copied glext.h and wglext.h from:
to my {BCB6 Root}/Include/GL folder

then, included in my project:

#include <GL\glext.h>
#include <GL\wglext.h>

Finally, i coppied in a glExtensions.h:


and in my main.cpp

PFNGLBLENDCOLORPROC glBlendColor; //pointer to the ext func
glBlendColor = (PFNGLBLENDCOLORPROC)wglGetProcAddress("glBlendColor");