PDA

View Full Version : Problems with the "genmath.inc" file



ianatwork
31-07-2007, 03:03 PM
I've transferred my Delphi game so that it compiles under Free Pascal. I then changed the settings so that I could compile a Linux version. The problem I am seeing is with the "genmath.inc" file. As it compiles Free Pascal stops with the message "Program generated a RTE 33 at address xyz. Save your sources and restart the IDE." I ok the error and it then says "The IDE generated an internal error and will now be closed." I have Lazarus installed and this is where Free Pascal is grabbing the units and include files from. Anyone got any ideas or had a problem with the "genmath.inc" file ?

marcov
28-10-2007, 12:18 PM
Genmath.inc is an includefile from the system unit that houses most floating point functions

This sounds like you have floating point assembler somewhere that doesn't emit a fwait. A lot of handcoded graphic libraries do this to speed up, but the problem is that a x87 (floating point) exception will only be caught at the "next" floating point assembler instruction.

So probably, there is some floating point CPU exception somewhere that is cannot be properly handled by the RTL because it doesn't have a fwait. Then the next time that trunc() is called, the exception is generated.

IOW the problem is most likely not in genmath.inc, but in some floating point code outside of it. This can be your code, but also e.g. a library like SDL. The easiest you can do is make a little procedure or so that calls trunc() on some constant and doesn't do much without it, and insert it here and there after library calls. The traceback might then help you find the problem