Forums

CCS 3.1 error

Started by p4pr...@gmail.com March 7, 2008
Hi,

I am working CCS v3.1. in tat i wan to do malloc of a simple array and i am getting the following linker error.

undefined first referenced
symbol in file
--------- ----------------
_malloc C:\Projects\AMSEC\AMSECTI\TIEx\mallc\Debug\mallc.obj
>> error: symbol referencing errors - './Debug/mallc.out' not built

i am using the cmd file and also defined the heap size of 1000 in the build option.

could any one give me a solution

Regards,
-Prassi
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Looks like you didn't include the headerfiles and maybe also didn't
locate the lib-file containing malloc?
You need to include stdlib.h to get the headerfile with the malloc
declaration. And then you'll also probably need to update your
build/link command options to point to the lib-file that defines
malloc.

On a sidenote: my philosophy when entering the embedded/realtime world
has been to avoid using malloc and use statically allocated memory. My
argument is that you have to account for all your memory use anyway
and you're also "alone" in your system (no other programs running like
on a PC), so using malloc is no big benefit. Any other opinions?
HTH,
Sima

On Fri, Mar 7, 2008 at 11:56 AM, wrote:
> Hi,
>
> I am working CCS v3.1. in tat i wan to do malloc of a simple array and i am
> getting the following linker error.
>
> undefined first referenced
> symbol in file
> --------- ----------------
> _malloc C:\Projects\AMSEC\AMSECTI\TIEx\mallc\Debug\mallc.obj
> >> error: symbol referencing errors - './Debug/mallc.out' not built
>
> i am using the cmd file and also defined the heap size of 1000 in the build
> option.
>
> could any one give me a solution
>
> Regards,
> -Prassi
>
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467