delorie.com/djgpp/bugs/show.cgi   search  
Bug 000328

When Created: 11/03/2000 01:36:01
Against DJGPP version: 2.03
By whom: Solaryn@hotmail.com
Abstract: Undefined reference to set_new_handler (void (*) (void))
The following program produces the error:

/* Start : test.cc */

#include <stdio.h>
#include <stdlib.h>
#include <new.h>

void MemHandler (void) {
  printf ("Error: Out of memory!\n");
  exit (-1);
}

int main (void) {
  set_new_handler (MemHandler);
  return (0);
}

/* End   : test.cc */

Compiled with: gcc -o test.exe test.cc
Produces: L:\TEMP\ccgdWRwv.o(.text+0x5b):test.cc: undefined reference to
          `set_new_handler(void (*)(void))'

Thanks for having a look see.

Regards,
 - Solaryn

Note added: 11/03/2000 16:27:27
By whom: Solaryn@hotmail.com
Addendum to the above.

Apparently I had it wrong, I forgot to link with GPP, rather than GCC.  Thus the
error is in my usage of the compiler.  Sorry for the inconvenience.

Regards,
 - Solaryn

Closed on 11/03/2000 16:31:13: Usage error, not a DJGPP bug.
By whom: Solaryn@hotmail.com



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