Using GLEE with Borland C++ Builder 6?


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) && !defined(PTRDIFF_T)

ifdef _WIN64

typedef __int64 ptrdiff_t;


typedef _W64 int ptrdiff_t; <-THIS IS THE LINE WITH THE ERROR



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


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 without GLEW or GLEE.After I got used to it I found GLEW unnecessary, at least for my current project.

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”);