Solved

Problem : borlandc++ 4.5 graphics.lib in linking

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 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 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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now