This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: new operator in fopen.cxx
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Broeske Marty-FMB223 <fmb223 at motorola dot com>
- Cc: "'ecos-discuss at sources dot redhat dot com'" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 06 Feb 2002 19:36:07 +0000
- Subject: Re: [ECOS] new operator in fopen.cxx
- Organization: Red Hat UK Ltd.
- References: <AD31C7ED267AD411B55500D0B781E33D035B49FE@il33exm02.wes.mot.com>
Broeske Marty-FMB223 wrote:
>
> Hey,
>
> I have had errors when linking with fopen() that the new operator is not defined. Seaching through the source I found that in all other instances where new is used the operator is defined within the module (see mutex.cxx). I solved my problem by including the following definition in fopen.cxx.
>
> inline void *operator new(size_t size) { return calloc(1,size); };
>
> I really don't feel good about this. I'm not a C++ expert but shouldn't there be a global definition for new somewhere?
Yes. At a guess you're using gcc v3. In which case you should add -lsupc++
to the link line for the time being.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine