DSPRelated.com
Forums

math/trigonometric functions frm dsplib

Started by nayakam January 13, 2003
Hello Everybody,

I was hoping that some of you might have faced a similar problem as I
am facing currently and would help me by giving some possible
solutions.

Here is a portion of my code "program.c"
**********

#include "dsk5416.h"
#include "stdlib.h"
#include "dsplib.h"
#include "tms320.h"
#include "math.h"
...
void decoder(float *isymbol,float *qsymbol,int *bitone,int *bittwo)
{ float Mod[6],*modang;
short isyms[6],qsyms[6],modan[6];
int index,streamLength;
modang=Mod;
streamLength=6;
fltoq15(isymbol,isyms,6);
fltoq15(qsymbol,qsyms,6);
atan2_16(isyms,qsyms,modan,6);
q15tofl(modan,modang,6);
for(i=0;i<streamLength;i++)
{if(sin(Mod[i])<0)
*(bitone+i)=1;
else
*(bitone+i)=0;
if(cos(Mod[i])<0)
*(bittwo+i)=1;
else
*(bittwo+i)=0;
}
return;
}
...
void main()
{
float I_Symbol[6]={...},*isymbol;
float Q_Symbol[6]={...},*qsymbol;
int Bit_One[6],Bit_Two[6],*bitone,*bittwo;
isymbol=I_Symbol;
qsymbol=Q_Symbol;
...
bitone=Bit_One;
bittwo=Bit_Two;
...
decoder(isymbol,qsymbol,bitone,bittwo);
}

***********
While Building the above file, there is an error corresponding to
symbol referencing errors. Hence the "program.out" is not built.

Error: symbol referencing errors- ./Debug/program.out not built
undefined symbol: _fltoq15,_atan2_16,_q15tofl
First referenced in file: "program.obj"

Is there any other way to circumvent this error, as similar problem
also arises if I use any other function from the "dsplib.h" file.
thanks in anticipation.

Amit J




Are you actually linking the correct libraries ? The #include will ensure
that the compiler accepts types and function definitions but it does not
mean the relevant code is actually included in your binary image. Your .CMD
file (if using the standard IDE) should have something like this:

-llnkrtdx.a54
-ldrivers.a54 /* device drivers support */
-lbios.a54 /* DSP/BIOS support */
-lrtdx.lib /* RTDX support */
-lcsl5402.lib
-lrtsbios.a54 /* C and C++ run-time library support */

HTH

Jerry ----- Original Message -----
From: <>
To: <>
Sent: Monday, January 13, 2003 9:31 PM
Subject: [c54x] math/trigonometric functions frm dsplib > Hello Everybody,
>
> I was hoping that some of you might have faced a similar problem as I
> am facing currently and would help me by giving some possible
> solutions.
>
> Here is a portion of my code "program.c"
> **********
>
> #include "dsk5416.h"
> #include "stdlib.h"
> #include "dsplib.h"
> #include "tms320.h"
> #include "math.h"
> ...
> void decoder(float *isymbol,float *qsymbol,int *bitone,int *bittwo)
> { float Mod[6],*modang;
> short isyms[6],qsyms[6],modan[6];
> int index,streamLength;
> modang=Mod;
> streamLength=6;
> fltoq15(isymbol,isyms,6);
> fltoq15(qsymbol,qsyms,6);
> atan2_16(isyms,qsyms,modan,6);
> q15tofl(modan,modang,6);
> for(i=0;i<streamLength;i++)
> {if(sin(Mod[i])<0)
> *(bitone+i)=1;
> else
> *(bitone+i)=0;
> if(cos(Mod[i])<0)
> *(bittwo+i)=1;
> else
> *(bittwo+i)=0;
> }
> return;
> }
> ...
> void main()
> {
> float I_Symbol[6]={...},*isymbol;
> float Q_Symbol[6]={...},*qsymbol;
> int Bit_One[6],Bit_Two[6],*bitone,*bittwo;
> isymbol=I_Symbol;
> qsymbol=Q_Symbol;
> ...
> bitone=Bit_One;
> bittwo=Bit_Two;
> ...
> decoder(isymbol,qsymbol,bitone,bittwo);
> }
>
> ***********
> While Building the above file, there is an error corresponding to
> symbol referencing errors. Hence the "program.out" is not built.
>
> Error: symbol referencing errors- ./Debug/program.out not built
> undefined symbol: _fltoq15,_atan2_16,_q15tofl
> First referenced in file: "program.obj"
>
> Is there any other way to circumvent this error, as similar problem
> also arises if I use any other function from the "dsplib.h" file.
> thanks in anticipation.
>
> Amit J >
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author
of this message will receive your answer. You need to do a "reply all" if
you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.yahoogroups.com/group/c54x
>
> Other Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ >