At 09:53 PM 3/5/2004, you wrote:
I still don't get it. The following works fine:

 MathLibPow(MathLibRef, (lon1 - lon2), 2, &d1);
 MathLibPow(MathLibRef, (lat1 - lat2), 2, &d2);
 MathLibSqrt(MathLibRef, (d1 + d2), &d3);
 d = e * d3;

This gets the link error:

d = e * sqrt(pow(lon1 - lon2, 2) + pow(lat1 - lat2, 2));

If I copy these items from mathlib.c into my program, link error goes away.

double pow(double x, double y) {
 double result;
 MathLibPow(MathLibRef, x, y, &result);
 return result;
}

double sqrt(double x) {
 double result;
 MathLibSqrt(MathLibRef, x, &result);
 return result;
}

What am I missing?

Nothing. mathlib.c is a file that is supposed to be added to your application and serves as a local wrapper of the shared library functions. I don't know what tools you are using, but if you're on CodeWarrior for Palm OS, and you use the wizard to build a new app that uses MathLib, you'll see that MathLib.c is part of the new project that's created.


-- Ben Combee, senior DTS engineer, PalmSource, Inc.
   Read "Combee on Palm OS" at http://palmos.combee.net/



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to