[comp.sys.mac] LSC math libraries on SE/30

sshimoji@nunki.usc.edu (Shunichi Shimoji) (06/20/89)

I have a trouble when using a LSC with co-processor on MacSE/30.
Could anyone give a help for this novice question?

The source file is shown below.
I compiled it with MacTraps, stdio and Math libraries,
and it produced correctly:
	log(100.000000)=4.605170

But when I used MathHybrid instead of Math, it produced
	log(?)=-0.000434
and when Math881, it even gave the link error
	undefined: log

I defined _MC68881_ macro for MathHybrid and Math881.
Why do they NOT work correctly?
Do I need recompile the libraries?
Is MC68882 not upper-compatible with MC68881?
I am using System6.02 and LSC v3.01 on MacSE/30.

------------------ Source Code ---------------------
#define _ERRORCHECK_
#define _MC68881_   /* This is commented in when using Math */
#include <stdio.h>
#include <math.h>

main()
{
   double x = 100.0;
   printf("log(%f)=%f\n",x,log(x));
}
----------------------------------------------------
S.Shimoji
sshimoji@nunki.usc.edu

siegel@endor.harvard.edu (Rich Siegel) (06/21/89)

In article <4150@merlin.usc.edu> sshimoji@nunki.usc.edu (Shunichi Shimoji) writes:
>
>The source file is shown below.
>I compiled it with MacTraps, stdio and Math libraries,
>and it produced correctly:
>	log(100.000000)=4.605170
>
>But when I used MathHybrid instead of Math, it produced
>	log(?)=-0.000434
>and when Math881, it even gave the link error
>	undefined: log
>
>I defined _MC68881_ macro for MathHybrid and Math881.
>Why do they NOT work correctly?

	Be sure to turn on 68881 code generation in the Options dialog.
That will solve your problem...

		--Rich

~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

 I classify myself as a real developer because my desk is hip-deep in
 assembly-language listings and I spend more than 50% of my time in TMON.

~~~~~~~~~~~~~~~