[LCP]Math problems

Alexandre Aguiar dev at amlr.cjb.net
Tue Nov 25 01:46:02 UTC 2003


Hi,

The following code will compile fine but won't link. Error message: undefined 
reference to 'pow'.

--------8><------------------------
#include <math.h>

double or_ci_limit(double a, double b, double c, double d, double z, double 
orc)
{
	return orc * pow( M_E, ( z * sqrt( 1/a + 1/b + 1/c + 1/d ) ) );
}
--------8><------------------------

The prefered 'exp' function will fail with the same message.

--------8><------------------------
#include <math.h>

double or_ci_limit(double a, double b, double c, double d, double z, double 
orc)
{
	return orc * exp ( z * sqrt( 1/a + 1/b + 1/c + 1/d ) );
}
--------8><------------------------


It is plain ansi code and both functions are standard ansi functions.
The 'exp' version compiled and linked fine with VC5 (windows thing) and 
correctly computes the confidence limits of an odds ratio (purpose of my 
small program.

I'd appreciate any effective help.

-- 

 
Alexandre Aguiar




More information about the linuxCprogramming mailing list