Archived

This topic is now archived and is closed to further replies.

error ?

This topic is 5181 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use the following glut functions in borland c++ in a (form) Why the code gives the following error? [Linker Error] Unresolved external ''glutInitDisplayMode'' referenced from C:\DOCUMENTS AND SETTINGS\ÞEBNEM AKBULUT\DESKTOP\PRJV2.1\PRJV21.OBJ [Linker Error] Unresolved external ''glutCreateWindow'' referenced from C:\DOCUMENTS AND SETTINGS\ÞEBNEM AKBULUT\DESKTOP\PRJV2.1\PRJV21.OBJ [Linker Error] Unresolved external ''glutDisplayFunc'' referenced from C:\DOCUMENTS AND SETTINGS\ÞEBNEM AKBULUT\DESKTOP\PRJV2.1\PRJV21.OBJ The code is; void __fastcall TForm1::Button4Click(TObject *Sender) { MessageDlg("Display Object.", mtInformation, TMsgDlgButtons() << mbOK, 0); GLfloat rtri; GLfloat x_t,y_t,z_t; int n1,n2,n3; glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("Your 3D Object"); glutDisplayFunc(RenderScene); SetupRC(); glTranslatef(0.0f,0.0f,-6.0f); glRotatef(rtri,1.0f,0.0f,0.0f); // Process each triangle .... Please help me..

Share this post


Link to post
Share on other sites
Did you include glut and its libraries?? Your linker thinks it should have those functions, but it cant find them. Thats why it is causing you trouble

Share this post


Link to post
Share on other sites
I ve included the following ;

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
#include <gl\glut.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <fstream.h>
#include <iostream.h>
#include <vcl.h>
#include <conio.h>
#include "prjv21.h"

Share this post


Link to post
Share on other sites
those are "header" files, not libraries..

you have to have sth like glut.lib or glut32.lib (I really don''t know the name) with lib extension.. you should insert it to your project.. I don''t know how to insert a lib into the project in Borland compiler, probably in preoject settings somewhere..

Share this post


Link to post
Share on other sites
When I add that it gives the following error message..

[Linker Error] ''C:\PROGRAM FILES\BORLAND\CBUILDER5\LIB\GLUT32.LIB'' contains invalid OMF record, type 0x21 (possibly COFF)

Share this post


Link to post
Share on other sites
negatory there man. the pragma works for cbuilder as well, but the file isnt compatible with cbuilder. search the web for a compatible one, or read in the documents how to convert the lib to cbuilder style...

Share this post


Link to post
Share on other sites