HELP error in Borland C

Discussion in 'Programmer's Corner' started by ¥öK'žy, Apr 16, 2008.

  1. ¥öK'žy

    Thread Starter Member

    Mar 27, 2008
    19
    0
    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...
     
  2. Mark44

    Well-Known Member

    Nov 26, 2007
    626
    1
    ¥ö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
     
  3. ¥öK'žy

    Thread Starter Member

    Mar 27, 2008
    19
    0
    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...
     
  4. Mark44

    Well-Known Member

    Nov 26, 2007
    626
    1
    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.
     
  5. mdew_47

    Member

    Mar 1, 2008
    22
    0
    ¥öK'žy,

    you are writing, a C or C++ program?
     
  6. ¥öK'žy

    Thread Starter Member

    Mar 27, 2008
    19
    0
    Im writing a C program.
     
  7. mdew_47

    Member

    Mar 1, 2008
    22
    0
    ........................:D
     
  8. ¥öK'žy

    Thread Starter Member

    Mar 27, 2008
    19
    0
    zzzz yeah I do....
     
  9. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    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.
     
  10. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
  11. JulioLowe

    New Member

    Oct 31, 2008
    2
    0
    Hi:cool:

    :) 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.:)


    www.sentersoftech.com
     
  12. JulioLowe

    New Member

    Oct 31, 2008
    2
    0
    Hi:rolleyes:

    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... and thank u :)

    www.bolg.sentersoftech.com
     
Loading...