?
Solved

Problem : borlandc++ 4.5 graphics.lib in linking

Posted on 1997-08-03
1
Medium Priority
?
288 Views
Last Modified: 2010-04-10
When I compile a source file with borland c++ 4.5, linker error message happens.
"Linker Fatal: Bad object file record in D:\BC45\LIB\graphics.lib near
module file offset 0x00000000 "
Source code is this:
#include <graphics.h>
#include <dos.h>

void put_ch(int ch,char saek)
{
        union REGS r;
        r.h.ah=0x0E;
        r.h.al=ch;
        r.h.bh=0;
        r.h.bl=saek;
        int86(0x10,&r,&r);
}

void xy_puts(int x,int y,char saek,char *str)
{
        gotoxy(x,y);
        while(*str!=0)
                put_ch(*str++,saek);
}

void main()
{
        int gd=DETECT,gm,i;
        initgraph(&gd,&gm,"\\TC");
        rectangle(0,0,200,200);
        circle(100,100,90);
        line(50,200,0,250);
        line(150,200,200,250);
        line(0,250,200,250);
        xy_puts(10,7,YELLOW,"minotor");
        xy_puts(10,15,GREEN,"body");

        gotoxy(1,17);
        for(i=0;i<13;i++)
        {
                put_ch(4,15);
                put_ch(5,15);
        }
        getch();
        closegraph();
}
0
Comment
Question by:skkpyj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 600 total points
ID: 1166644
I think the error has nothing to do with your source code. It is likely that the graphics.lib is corrupted. You need to reinstall it or copy a new graphics.lib. Also, use ScanDisk to scan your hard disk.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question