I am using the wavelet code from numerical recipes in C.
http://www.library.cornell.edu/nr/bookcpdf/c13-10.pdf
When I try to call a function that calls another function I get the following error in MS Visual C++:
wavelet.obj : error LNK2001: unresolved external symbol "void __cdecl wt1(float *,unsigned long,int,void (__cdecl*)(float *,unsigned long,int))" (?wt1@@YAXPAMKHP6AX0KH@Z@Z)
Debug/w3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
The relevant code is as follows:
void daub4(float *, unsigned long, int);
void wt1(float *, unsigned long, int, void (*)(float [], unsigned long, int));
void main(){
...
wt1(x, numPoints-1, 1, daub4);
...
}
void wt1(float a[], unsigned long n, int isign,
float(*wtstep)(float [], unsigned long, int)){
//One-dimensional discrete wavelet transform. This routine implements the pyramid algorithm,
//replacing a[1..n] by its wavelet transform (for isign=1), or performing the inverse operation
//(for isign=-1)
//. Note that n MUST be an integer power of 2. The routine wtstep, whose
//actual name must be supplied in calling this routine, is the underlying wavelet .lter. Examples
//of wtstep are daub4 and (preceded by pwtset) pwt.
unsigned long nn;
if (n < 4) return;
if (isign >= 0) { //Wavelet transform.
for (nn=n;nn>=4;nn>>=1) (*wtstep)(a,nn,isign);
//Start at largest hierarchy, and work towards smallest.
} else { //Inverse wavelet transform.
for (nn=4;nn<=n;nn<<=1) (*wtstep)(a,nn,isign);
//Start at smallest hierarchy, and work towards largest.
}
}
void daub4(float *a, unsigned long n, int isign){
.......
.......
}
Please help me to pass daub4 into wt1!
Thanks,
*Bob_ptr