setup opengl in Borland c++ 5.0 please help

I am having problems setting up Borland c++ to compile Opengl codes correctly. Here is what I did. I put the glut header files in the "/include/gl/ " directory of borland and put the lib files in the “/lib/gl/” directory. I do not know where to put the dll files included in glut3.6 so i just left them out. when i open new file then open NeHes lesson 1 for borland c++, it will compile sucessfully, but when I try to run it, it gave me errors about internal referance?? any help is greatly appreciated, thank you.


I don’t know how I got that to work, but I did with Borland C++ Builder 5.02. My problem is with NeHe’s lessons 6, 7, and 8, concerning textures, where the compiler does not recognize the glgentextures() and glbindtexture() functions within the header files…probably because there aren’t any? If I compile it using Microsoft’s evil Visual C++ 6.0 tool, I don’t get this problem. Any suggestions?

As of AndyAndy’s problem, don’t use the downloads that are posted on NeHe’s site; I have problems using them with Borland 5.02. I’d just copy and paste the code from the HTML lesson directly into the Borland text edit, and then I’d be fine. Hope this helps.

I just copied all of the lines of code from NeHe’s page and now I have a tingling pain in my right hand… +_+
It compiled ok on Borland, but when I try to run the program it gave me an error: " unresolved external error ‘_maim’ referenced from c:\bc5\lib\cox32.obj" what does this mean

I use borland but only from the command line. I found it the best solution: a powerful editor and the command line.
No VCL, no Forms.
In this way you can use directly the SAME code of nehe’s tutorials.
The problem with glGenTextures is because the headers are old. I downloaded somewhere newer headers (gl.h, glu.h). Maybe I also imported libs from dlls with implib but I don’t remember.

I use this .bat bile:

@echo off
set PATH=c:\programmi\cbuilder\bin

And a makefile like this:




!ifndef BCB


PROJECT = zzDemo.exe
OBJFILES = zzDemo.obj drivers.obj renderer.obj fonts.obj lights.obj materials.obj textures.obj camera.obj image.obj monitor.obj objects.obj 3dsloader.obj message.obj math3d.obj console.obj
LIBFILES = gdi32.lib user32.lib kernel32.lib cw32mt.lib opengl32.lib glu32.lib winmm.lib

*** Compiler Options ***

warnings, align dword, fast math, no standard stack frame, pentium instructions, optimize speed

CPPFLAGS = -w -a4 -ff -k- -5 -O2 -OS

*** Linker Options ***

win32 api, win32 exe, suppress map file, win95

LFLAGS = -aa -Tpe -x -V4.0 -L$(BCB)\lib

ilink32 $(LFLAGS) C0w32.obj $(OBJFILES), $(PROJECT), $(LIBFILES)

zzDemo.obj: zzDemo.cpp renderer.h $(COMMH)
renderer.obj: renderer.cpp renderer.h drivers.h fonts.h lights.h objects.h camera.h $(COMMH)
drivers.obj: drivers.cpp drivers.h console.h $(COMMH)
fonts.obj: fonts.cpp fonts.h $(COMMH)
lights.obj: lights.cpp lights.h $(COMMH)
camera.obj: camera.cpp camera.h $(COMMH)
objects.obj: objects.cpp objects.h materials.h $(COMMH)
3dsloader.obj: 3dsloader.cpp objects.h materials.h $(COMMH)
materials.obj: materials.cpp materials.h textures.h $(COMMH)
textures.obj: textures.cpp textures.h image.h $(COMMH)
console.obj: console.cpp console.h fonts.h $(COMMH)
image.obj: image.cpp image.h
math3d.obj : math3d.cpp math3d.h
message.obj: message.cpp message.h
monitor.obj: monitor.cpp monitor.h math3d.h
#driverGL.obj: driverGL.cpp driverGL.h


&bcc32 $(CFLAGS) -c $**

del *.obj


Then when I want to compile I call “make”, when I want to delete all object files to rebuild all I call “make clean”.
And with a dbl click my app run.

Hope this helps…