set_new_handler

Mumit Khan khan@xraylith.wisc.EDU
Fri Apr 30 18:32:00 GMT 1999


Sven.Wastlund@epkadm.epk.ericsson.se (Sven Wastlund) writes:
> I am porting a program from UNIX to NT which uses the function set_new_handle
> r and I linked it with libgcc.a but I still got the error:
>> undefined reference to set_new_handler

Without any code, it's impossible to figure out why you're getting this.
Post a short test case and someone will look into it. Short answer is
that it's there and it works.
Are you including <new> in your code to pick up the right prototype?
> Is there any other library I can use?

no.
here's a quick example (haven't tested it, so beware for syntax errors
and so on):
 #include <new>
 #include <iostream>
 void my_handler () {
 cerr << "no more memory" << endl;
 abort ();
 }
 int main( void ) {
 set_new_handler (&my_handler);
 int *foo = new int [100000000];
 }
$ c++ -o new-handler new-handler.cc
$ ./new-handler
Regards,
Mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /