Solved

Problem : borlandc++ 4.5 graphics.lib in linking

Posted on 1997-08-03
1
256 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

785 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