By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,101 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Watcom c++ exceptions in dos4g give undef on good ole ___wcpp_4_fs_handler_

P: 3
Well try catch compile, link and work ok when l=nt is used, however when l=dos4g is used the jolly old ___wcpp_4_fs_handler_ comes up as an undef with an additional warning of __compiled_under_NT as an undef too, however only the handler is the "final" undef being referenced out of plbx3r.lib(FSHAND).

This problem occurs going all the way back to OW 1.2 strangely it does not occur for watcom 10.6

I have tried to stick in all the ex... headers but to no avail. When linked as nt or dos4g(watcom 10.6) no extra header files are required anyway.

Here is a simple program that will demo the aggravation:
Expand|Select|Wrap|Line Numbers
  1. #include <iostream.h>
  2.  
  3.   int divide(int divisor, int dividend) throw (const char*)
  4.   {
  5.     if (dividend == 0)
  6.       throw (const char*)"Division by zero attempted";
  7.  
  8.     // Here we don't have to worry about dividend being zero
  9.  
  10.     return divisor/dividend;
  11.   }
  12.  
  13.  
  14. int main(void)
  15.   {
  16.     try {
  17.       int result = divide(50,2);
  18.       cout << "divide(" << 50 << ", " << 2
  19.            << ") yields " << result << endl;
  20.       result = divide(50,0);
  21.       cout << "divide(" << 50 << ", " << 0
  22.            << ") yields " << result << endl;
  23.     }
  24.     catch (const char* msg) {
  25.       cout << "Oops, caught: " << msg << endl;
  26.     }
  27.  
  28.     return 0;
  29.   }
  30.  
Anyone any ideas?
Sep 4 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.