HELP error in Borland C

Thread Starter

¥öK'žy

Joined Mar 27, 2008
19
Hi all, I have an error message when using borland C.
Hope you can help me...

When i run the program, sometime the borland is stop responding or terminated and there is a message box:

"The NTVDM CPU has encountered an illegal instruction.
CS:0000 IP:015b OP:f0 19 e8 00 f0 Choose 'Close' to terminate the application"

What's happening here????

And another error is when I use graphics.h, there is an error when I compile the program:(( yes, i have include graphics.h )

"Linker error: Undefined symbol _x in module noname.cpp"

*where 'x' is ALL of the function in graphics.h
i.e : Linker error: Undefined symbol _initgraph in module noname.cpp

Can anyone help me please?? Cause I have the same error when using Turbo C...
 

Mark44

Joined Nov 26, 2007
628
¥öK'žy,
I don't know why you're getting the first error you listed. I'll need some more information on that one, such as more details about what you're doing wh when you get this error.

For the linker error, your program is including graphics.h, but your project doesn't include the DLL or .lib file that contains the code for the functions in graphics.h. I used to have the Borland compiler long ago, but don't any longer, so I don't know the name of the dll or lib with the graphics functionality.

The graphics.h header file probably has only function prototypes, or declarations in it. (Sometimes a header will contain code, but mostly they don't.) The prototypes/declarations tell the compiler the name of the function, how many args it has, the types of the args, and the type to be returned. The prototype doesn't ordinarily give any information on how the function does what it does.

The function definition (i.e., what it does) is usually stored in a dll or lib file. The linker is giving you the errors you show because it can't find the definitions of the graphics functions your program is calling. You need to set up your build configuration so that the right dlls and/or libs are included. If you have any documentation on the Borland headers, it should say what dll/lib the code is in.

Mark
 

Thread Starter

¥öK'žy

Joined Mar 27, 2008
19
Hi Mark,
Thanx for the reply, it seem like the first error occur when I compile some program that I get from planetsourcecode which is has an error in it. Strangely, the compiler didn't show the error message but suddenly terminated. After I fix the error, it didn't happen again.

For the second error I mentioned before, It has never happen before. The day before I write this thread, I was compiling a program with graphics and it's doing allright.
But after I got a virus @#$%, which make all of my .exe can't be deleted nor edited, the error happen.....
Seems like boot.exe virus but I can't detect it with NOD antivirus until now T_T...
 

Mark44

Joined Nov 26, 2007
628
You didn't mention a virus before, so I was assuming that you had a normally operating system. Obviously you'll need to get rid of the virus.
 

n9352527

Joined Oct 14, 2005
1,198
graphics.h, you are writing a graphical DOS program? And running it on command box on Windows? If so, that would be problematic. It is not easy running graphical DOS program on command box.
 
Top