[ECOS] undefined reference to `operator new(unsigned)'

Brian Murphy brm@tt.dk
Fri Feb 7 07:24:00 GMT 2003


Jonathan Larmour wrote:

> Calvin Du wrote:
>
>> Hi Macro,
>>
>> I have a similar problem you had before while
>> compiling
>> ecos(v1.3.1) by using gcc 3.2.1:
>
>
> Don't use 1.3.1, use anoncvs.
>
>> ..../packages/language/c/libc/current/src/clibincl/stream.inl:260:
>> undefined reference to `operator new(unsigned)'
>> collect2: ld returned 1 exit status
>>
>> As you commented in the attached e-mail, "Applying the
>> few fixes" will fix the problem. I searched the
>> mailing
>> list archives, but it was hard to find. Could you tell
>> me where can I find it or how to fix it?
>
>
> If you're using gcc 3.2.1, you'll need to build gcc 3.2.1 with newlib 
> and libstdc++ included. Search the list archives (see below for link).
>
> Jifl

As an alternative to this you can compile and link this code with your 
image :

#include <stddef.h>
#include <stdlib.h>

void *
operator new(size_t sz) throw()
{
    return (void *)malloc(sz);
}

void *
operator new[] (size_t sz) throw()
{
    return ::operator new(sz);
}



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list