473,503 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can one resolve a linking problem in c graphics.h

Expand|Select|Wrap|Line Numbers
  1. void main()
  2. {
  3.     int gd=DETECT,gm;
  4.     initgraph(&gd,&gm,"c:\\tc\\bgi");
  5.     setcolor(GREEN);
  6.     settextstyle(4,0,8);
  7.     outtextxy(200,50,"TIME");
  8.     setcolor(YELLOW);
  9.     settextstyle(4,0,8);
  10.     outtextxy(100,190,"SCHEDULER");
  11.     settextstyle(1,0,1);
  12.     setcolor(RED);
  13.     outtextxy(480,350,"Made By:");
  14.     setcolor(BLUE);
  15.     outtextxy(480,370,"Atiq Anwar");
  16.     getch();
  17.     restorecrtmode();
  18. }
  19.  
  20.  
  21. error-
  22. linking error..undefined symbol setcolor
  23. linking error..undefined symbol settextstyle
  24. linking error..undefined symbol outtextxy
  25. linking error..undefined symbol restorecrtmode
  26. linking error..undefined symbol initgraph
  27.  
  28.  

plzzzzzz help thnx alot
Oct 24 '10 #1
2 4847
weaknessforcats
9,208 Recognized Expert Moderator Expert
For example, you are using a symbol setcolor and the compiler doesn't know what that is.

I don't know what that is either. Is a a variable? a function?

You cannot use any symbol unless you have first declared what it is.

Maybe you are missing a header file.

BTW: main() returns int not void.
Oct 24 '10 #2
donbock
2,426 Recognized Expert Top Contributor
This is a linker error, not a compiler error. That is, you are including the right header. This header promises the compiler that these functions exist and that they will be available for the link editor phase. However, the link editor can't find those functions so it complains that you broke your promise.

Typically, promised external functions like these are either provided in an object file or an object library. The method of providing either of these varies by compiler.

In gcc, you specify an object file by including it on the command line with all of the other input files; you specify an object library with the -l command line switch.
Oct 24 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1592
by: Pudibund | last post by:
Ok, I've spent nearly a week trying to sort what should be an easy task to accomplish but I'm totally flumoxed! I want to do something pretty simple... 1. display image1 2. wait until...
7
5072
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
2
1630
by: sb | last post by:
Hello. I have three files in a VC++6 project - a header file called Schedule.h, an implementation class called Schedule.cpp and a test class with main called TestSchedule1.cpp. It compiles fine in...
20
3197
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
2
2879
by: Simon Bitchenor | last post by:
I am linking an Access 97 front-end database to an ODBC data source (Sage Line 50 Version 9). Running the link on a Windows 98 PC the performance of the linked table is instant. Running under...
5
1843
by: SJ | last post by:
Hi, I'd like to pu text fixed fith graphics and equations onto some control. And I don't know which one. I tried to use TRichEdit but its doesn't show graphics and eqation. How can I show these...
2
3044
by: Nicholas Witchey | last post by:
Does anyone know of a set of graphics libraries written in C#? My goal is to create a set of graphics images in memory then dump them to a file or network stream in any format. Unfortunately...
2
7226
by: | last post by:
Help! I'm new to c++, and am breaking my teeth on MS Visual C++ (bundled within Visual Studio .NET 2003). Am trying to link simple c++ code to fortran dlls created in Compaq Visual Fortran (v6.1)....
7
6529
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
3
4358
by: walkeraj | last post by:
I'm trying to compile an open source game called IVAN , and I'm able to compile it from a makefile, but not from an IDE. I have attempted to recreate the way the makefile compiles the project as...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.