Code generated by OpenWatcom C using floating point numerics won't run on a PC-XT.

gauss1234

Beta member
Messages
3
After I commented floating point code out of the program, the rest would run on the XT (V40, no FPU)

This simple program will build, but crashes the computer:

#include <math.h>
#include <stdio.h>

int main(void)
{
printf("%f\n",sqrt(2));
}

These compile-time options were used:
CFLAGS = -1 -fpc -ml -j -bt=dos -ohk -zp1 -os -zt32 -I$(%WATCOM)/h -D$(SYSTEM)

The program runs fine on anything 386+, with or without an FPU.

So, what am I doing wrong?
 
I solved my own problem. I had to use an older version of OpenWatcom. I tested several versions and found that v1.3 was the latest that handled 16-bit floating point code properly. During compile, only the -fpc option can be used, and not -fpi.

Secondly, to avoid the "Floating-point support not loaded" error, I had to run these commands:
cd [OpenWatcom folder]\lib286\dos
wlib graph -DUMMY
 
Sorry none of us could do more to help you out earlier; just none of us are probably familiar with OpenWatcom.

Glad you got it worked out though and thanks for posting your fix; hopefully it helps somebody else out as well.
 
Back
Top Bottom