home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11747 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.1 KB  |  47 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!rpi!losaccom
  3. From: losaccom@cs.rpi.edu (Mark LoSacco)
  4. Subject: _new_handler????
  5. Message-ID: <-l1x0jr@rpi.edu>
  6. Nntp-Posting-Host: hyades.cs.rpi.edu
  7. Organization: Rensselaer Polytechnic Institute
  8. Date: Wed, 29 Jul 1992 20:19:24 GMT
  9. Lines: 36
  10.  
  11.  
  12.    I was hoping someone here might be able to help me out.
  13. I am using the latest g++ compiler, and am trying to set the
  14. supposed system variable "_new_handler" to point to a function
  15. that will be called whenever an out-of-memory error occurs.
  16.  
  17.    I say supposed because when I try to compile it, I get the
  18. message: Undefined symbol __new_handler referenced from text
  19. segment.  
  20.  
  21.    My code looks like this...
  22.  
  23.    extern void ( *_new_handler )();
  24.  
  25.    main()
  26.    {
  27.       _new_handler = &out_of_memory;
  28.  
  29.       ...etc
  30.    }
  31.  
  32.    void out_of_memory()
  33.    {
  34.       <print error message & terminate>
  35.    }
  36.  
  37.  
  38.    Since I am following directly from a C++ book I have,
  39. I suspect that g++ knows this system variable under a 
  40. different name.
  41.  
  42.    Can anybody help me out on this one?
  43.  
  44.                 Thanks,
  45.                 Mark 
  46.                 losaccom@cs.rpi.edu
  47.