GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Nov-2008, 08:08
bcompt143 bcompt143 is offline
Awaiting Email Confirmation
 
Join Date: Apr 2008
Posts: 22
bcompt143 is on a distinguished road
Thumbs down

Problem with using graphics.h


I have got some problem using graphics.h library of c++, after writing my program and complaining it, it did not show any error but when I'm trying to run it display such type of error. undefined symbol "any graphics.h functions" example intigraph(to initialize the graph).
my compliers are Turbo c++ version 3.0 and 4.5.
this is my program
CPP / C++ / C Code:
#include<graphics.h>

#include<conio.h>

#include<dos.h>

#include<math.h>



# define pi 3.141592736



float cosa,cosb,sina,sinb;

void ini(float cos1,float cos2)

{

 cosa=cos(cos1*pi/180);

 cosb=cos(cos2*pi/180);

 sina=sin(cos1*pi/180);

 sinb=sin(cos2*pi/180);

}

void plot(int x,int y,int z,int &x1,int &y1)

{

 x1=x*cosa-y*sina;

 y1=x*sina*sinb+y*cosa*sinb+z*cosb;

 x1=320+int(x1);

 y1=240-int(y1);

}

void main()

{

 int gd=DETECT,gm;

 initgraph(&gd,&gm,"c:\\tc\\bgi");

 int p=0;

 while(!kbhit())

 {

 ini(p,p);

 int x[5],y[5];

 plot(5,5,1,x[0],y[0]);

 plot(45,5,1,x[1],y[1]);

 plot(5,45,1,x[3],y[3]);

 plot(45,45,1,x[4],y[4]);

 setcolor(RED);

 line(x[3],y[3],x[4],y[4]);

 line(x[1],y[1],x[4],y[4]);

 line(x[0],y[0],x[3],y[3]);

 line(x[0],y[0],x[1],y[1]);



 plot(25,25,140,x[2],y[2]);



 for(int i=0;i<5;i++)

  {

  setcolor(BROWN);

  line(x[2],y[2],x[i],y[i]);

  }

 p+=3;

 delay(20);

 cleardevice();

 }

}
please any try to help me.
in addition any one who have any reading material about graphics library and how to make interface using c++ please send me.
  #2  
Old 10-Nov-2008, 09:03
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: Problem with using graphics.h


Quote:
Originally Posted by bcompt143
I have got some problem using graphics.h library of c++...
Numerous comments:
  • Graphics is not part of the language standard, so you are moving out of the language standard & into vendor-specific additions.
  • graphics.h is not a library; it is simply a header file providing declarations & prototypes in order for the compiler to create object files.
  • The problem you are specifying is that the library was not included when linking. I don't know how you are creating your application (within some GUI or at the command-line...), but you will need to figure out how to explicitly pass the name of Borland's graphics library to the linker.
  • Lastly, when posting code, please place a [cpp] tag before the code & [/cpp] tag afterwards. This will preserve formatting & color-code all keywords & identifiers.
  #3  
Old 12-Nov-2008, 01:23
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Problem with using graphics.h


tcc programname graphics.lib
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Torrents Download Problem chandeep Computer Software Forum - Linux 7 09-Oct-2006 23:37
Graphic problem in Unreal Tournament 2004 zerox Computer Software Forum - Games 10 09-Oct-2005 13:31
Runtime Problem involving "printf" in C Program supamakia C Programming Language 2 09-Oct-2005 11:09
a significant problem after installing Xp mohammad Computer Software Forum - Windows 10 09-Aug-2005 08:03

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:20.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.