Solved

Problem : borlandc++ 4.5 graphics.lib in linking

Posted on 1997-08-03
1
274 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
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 200 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

749 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