help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libraries for exception handling?


From: David Olsson
Subject: Re: Libraries for exception handling?
Date: 22 Sep 2004 23:26:20 -0700

Guy Harrison <swamp-DEL-dog@ntlworld.com> wrote in message 
news:<lngric.mh61.ln@sd-if.swampdog>...
> David Olsson wrote:
> 
> > Maurizio Loreti <mlo@foobar.it> wrote in message
> > news:<rmu0tr8zto.fsf@mlinux.pd.infn.it>...
> >> You invoke g++, not gcc, in the command line --- right?
> > 
> > Yes I invoke g++, but it really wouldn't matter if I invoked gcc since
> > I explicitly use ld to link and don't link with any of the default
> > libararies (like -lstdc++ and -lsupc++) since, in the case of
> > -lstdc++, I don't use any of its functonalities (at least not
> > explicitly) and should thus not require it(?), and, in the case of
> > -lsupc++, it makes use of malloc() and free() which defintately is off
> > limits on this platform.
> 
> Why?
>  
> > What I really need is a way to be able to use exception handling (if I
> > remove all exceptions from the code, the linking works just fine)
> > without having to link with a library that uses malloc() and free().
> > Any ideas?
> 
> Implement your own malloc.

I am currently implementing my own malloc and free. I link with
libiberty.a instead if libc.a. As libiberty.a also implements malloc
and free, how do I know which one gets called, mine or libiberty.a's?
Actually, I would have guessed that the linker would have complained
about this...

Anyway, I now get an undefined reference to fwrite (which I guess I
could solve by implmeneting my own dummy fwrite) and an undefined
reference to _impure_ptr (which I have no idea what it is). Does
anyone have an idea on how to solve the latter undefined reference?

Thanks!
David Olsson


reply via email to

[Prev in Thread] Current Thread [Next in Thread]