www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/10/23:10:03

Date: Wed, 10 Sep 1997 20:07:55 -0700 (PDT)
Message-Id: <199709110307.UAA07693@adit.ap.net>
Mime-Version: 1.0
To: Carsten =?iso-8859-1?Q?Sch=E4uble?= <schauble AT inf DOT fu-berlin DOT de>,
djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: undefined reference to __builtin_delete

At 04:31  9/10/1997 +0200, Carsten Schäuble wrote:
>i compile a complete independent (no includes, no inheritance) c++ class
>with
>
>	gcc -c -Wall -o ctrl.o ctrl.c
>
>if i define my own destructor in the class, the linker
>
>	ld -t -oformat coff-go32 -e startup -Ttext 0x10000 -o system startup.o
>main.o ctrl.o
Do you have some objection to using the standard startup code and libraries?
>
>aborts with error
>
>	ctrl.o(.text+0x15):ctrl.cc: undefined reference to __builtin_delete
>
>if the destructor is not defined (the standard destructor is used), so
>it works fine
I assume your destructor uses `delete'. The delete operator lives in
libgcc.a, so you'll have to link with it. If it complains about unresolved
references to `free', you'll need to link with the C library as well.
HTH

 

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019