Mail Archives: djgpp/2001/08/14/05:43:58
> From: "Luis Filipe Fabiani" <luis2 AT becrev DOT com>
> Date: Mon, 13 Aug 2001 21:08:40 -0300
>
> When I try to compile my C program on Red Hat 7 (with gcc -lm), I execute my
> program and it works fine.
> When I try to compile my program with DJGPP on windows ME, the source
> compiles, but the program produces a result that is VERY different...
>
> This program executes a lot of calculations (its a CFD (Computation Fluid
> Dinamics))
It's hard to tell, without more information about what the program
does (or, more accurately, HOW does it do that). Here are a few ideas
to try:
- Try linking the program without -lm. It might fail (if it uses
math functions that are only available in libm.a); if so, try
putting "-lc -lm" (in that order!) at the end of the link command
line. This will cause the program to use a different version of
some of the math function; perhaps that will help.
- Use the matherr facility to see whether your program calls some
math functions with invalid arguments. (For details about this,
type "info libc alpha matherr" from the shell prompt, and read
there.)
As Martin suggested, checking the GCC versions and compilation
switches is also a good idea.
If none of the above helps, the only way to debug this is to run the
program under a debugger, put a breakpoint on the spot where the
difference starts to show, and poke around to see what's going on.
- Raw text -