Solved

Problem : borlandc++ 4.5 graphics.lib in linking

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

Independent Software Vendors: 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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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.

732 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