PDA

View Full Version : OpenGL for Windows-95



Rajesh
02-08-2000, 12:25 AM
I downloaded OpenGL95 and Glutdlls37 beta.When I unzipped them I got a bunch
of header files, dlls, .lib files. I am using
Borland C++ /Builder 4. Into which directories should I load these files. I tried loading .h into /borland/header .lib into /borland/lib and .dlls into /borland/bin
directories. But it gives me compilation errors saying wingdapi is multiply defined.Can anybody help me setup this.

paolom
02-08-2000, 05:54 AM
Have you tried including windows.h before gl.h?

Rajesh
02-08-2000, 07:19 AM
Originally posted by paolom:
Have you tried including windows.h before gl.h?

Yes, it worked now. Thank you. But now
I am getting some linker errors such as

[Linker Error] Unresolved external 'glutInit' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER4\PROJECTS\PROJECT2.OBJ.

I got the same message for all the functions I have used.
But I have copied my glut.lib to my default
library which is specified in the Project/options/Directories/Library path.
Any idea how to solve this.

paolom
02-08-2000, 07:28 AM
It seems you only left out to tell the linker which libs to link to.
It should be somewhere in the project settings: you'll have to link in opengl.lib, glu.lib, and also glut.lib, from what I can deduce. Beware to use the right .LIB files, because the xxx32.lib usually are for VC

BJuano
02-08-2000, 03:24 PM
you'll have to link in opengl.lib, glu.lib, and also glut.lib

Good suggestion. I just wanted to note that in Borland C++Builder 4 opengl32.dll and glu32.dll are linked in for you in the import32.lib file for MS's OpenGL 1.1. To use glut, you do need to link an import library for that .dll.
Use this command line
implib glut.lib glut.dll
and add glut.lib to your project via the project manager.

BJuano
02-08-2000, 03:28 PM
But I have copied my glut.lib to my default
library which is specified in the Project/options/Directories/Library path.
Any idea how to solve this.

Just pointing to the directory is not enough. You have to explicitly link to it by adding it to your project or adding it to the LIBRARIES macro in the makefile(*.bpr).
May I suggest using the VCL instead of glut since you are using Builder.
You can find an article on how to do it at: http://community.borland.com/article/0,1410,10528,00.html
Good luck.

Rajesh
02-08-2000, 09:32 PM
Originally posted by BJuano:


But I have copied my glut.lib to my default
library which is specified in the Project/options/Directories/Library path.
Any idea how to solve this.

Just pointing to the directory is not enough. You have to explicitly link to it by adding it to your project or adding it to the LIBRARIES macro in the makefile(*.bpr).
May I suggest using the VCL instead of glut since you are using Builder.
You can find an article on how to do it at: http://community.borland.com/article/0,1410,10528,00.html
Good luck.


I added the glut.lib file to my project using this USELIB("..\Bin\glut32.lib");
but the linker says this style of function
definition is obsolete and generates an error. Any Clue on what this is.

Thanks

BJuano
02-09-2000, 10:22 AM
Originally posted by Rajesh:

I added the glut.lib file to my project using this USELIB("..\Bin\glut32.lib");
but the linker says this style of function
definition is obsolete and generates an error. Any Clue on what this is.


Builder can be picky with these macros. Did you add this yourself or did you add the file to the project (with the Project Manager) and let the IDE add that macro for you? I suggest the latter.

Rajesh
02-10-2000, 11:16 AM
Originally posted by BJuano:
Builder can be picky with these macros. Did you add this yourself or did you add the file to the project (with the Project Manager) and let the IDE add that macro for you? I suggest the latter.


I did not add the statement myself . I did
and Add to Project from the Project drop down menu and gave the path of this library file. Is there a site for troubleshooting tips .

BJuano
02-10-2000, 03:11 PM
Originally posted by Rajesh:

Is there a site for troubleshooting tips .
Try asking this question on the Borland newsgroups
NNTP: forums.borland.com
group: borland.public.cppbuilder.graphics