DSPRelated.com
Forums

How to make a command linker file for simple program?

Started by hend...@yahoo.com January 14, 2008
I have a simple c program to open a .dat file then print that on the output screen. When i build with ccs it need a command linker file and i don't know hot to make it. I'm using TMS320VC5416.

This is the .c program
#include
#include

void main()
{
FILE *am;
int a=0,c;
float b[58];
puts("Start");
if((am=fopen("hilbert.dat","r"))== NULL)
printf("error");
else
{
for(a=0;a<57;a++)
{
fscanf(am,"%f",&b[a]);
}
fclose(am);
}
for(c=0;c printf("%f\n",b[c]);

puts("END\n");
}

and this is hilbert.dat

-0.000000000000009
0
-0.048970751720575
0
-0.000000000000008
0
-0.057874524760682
0
-0.000000000000006
0
-0.070735530263059
0
-0.000000000000005
0
-0.090945681766793
0
-0.000000000000004
0
-0.127323954473513
0
-0.000000000000003
0
-0.212206590789192
0
-0.000000000000001
0
-0.636619772367581
0
0
0
0.636619772367581
0
0.000000000000001
0
0.212206590789192
0
0.000000000000003
0
0.127323954473513
0
0.000000000000004
0
0.090945681766793
0
0.000000000000005
0
0.070735530263059
0
0.000000000000006
0
0.057874524760682
0
0.000000000000008
0
0.048970751720575
0
0.000000000000009

And please correct the c program if it still wrong. Thx a lot!
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Hendy-

> I have a simple c program to open a .dat file then print that on the
> output screen. When i build with ccs it need a
> command linker file and i don't know hot to make it. I'm using
> TMS320VC5416.

It looks to me like you and Christian CS are doing almost the same project. Maybe Christian can send you his file?
He said he got his from the ../tutorial/dsk5416/shared subfolder under the TI path.

The CCS tutorials are always a good place to start.

-Jeff

> This is the .c program
> #include
> #include void main()
> {
> FILE *am;
> int a=0,c;
> float b[58];
> puts("Start");
> if((am=fopen("hilbert.dat","r"))== NULL)
> printf("error");
> else
> {
> for(a=0;a<57;a++)
> {
> fscanf(am,"%f",&b[a]);
> }
> fclose(am);
> }
> for(c=0;c > printf("%f\n",b[c]);
>
> puts("END\n");
> }
>
> and this is hilbert.dat
>
> -0.000000000000009
> 0
> -0.048970751720575
> 0
> -0.000000000000008
> 0
> -0.057874524760682
> 0
> -0.000000000000006
> 0
> -0.070735530263059
> 0
> -0.000000000000005
> 0
> -0.090945681766793
> 0
> -0.000000000000004
> 0
> -0.127323954473513
> 0
> -0.000000000000003
> 0
> -0.212206590789192
> 0
> -0.000000000000001
> 0
> -0.636619772367581
> 0
> 0
> 0
> 0.636619772367581
> 0
> 0.000000000000001
> 0
> 0.212206590789192
> 0
> 0.000000000000003
> 0
> 0.127323954473513
> 0
> 0.000000000000004
> 0
> 0.090945681766793
> 0
> 0.000000000000005
> 0
> 0.070735530263059
> 0
> 0.000000000000006
> 0
> 0.057874524760682
> 0
> 0.000000000000008
> 0
> 0.048970751720575
> 0
> 0.000000000000009
>
> And please correct the c program if it still wrong. Thx a lot!

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467