• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: undefined __throw
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined __throw


  • Subject: Re: undefined __throw
  • From: Jeremy Sagan <email@hidden>
  • Date: Thu, 07 Jul 2005 19:18:44 -0400

Obviously I am a newbie with Xcode and C++ exceptions but I can't understand why this other simple program I found online does not compile.

After having linking problems with try, catch and throw, I tried creating a new carbon project but when I try to compile it, xcode cannot find iostream.h even though "iostream.h" will open-quickly without problem. I tried changing my header paths but that does not seem to help.

Please help. Here is the file c++ test file I found....

/ ************************************************************************ **
*
* Language: C++
* Purpose: Program to demonstrate the 'try', 'catch' and 'throw' statements.
* Author: M J Leslie
* Date: 21-Mar-98
*
* Compile: The following command was used to compile.
*
* g++ -fhandle-exceptions throw.cc -o throw
*
************************************************************************ **/


#include <iostream.h>                  // For cout.

void ErrorFunc(int Error);

main()
{
    ErrorFunc(0);
    ErrorFunc(1);
}
void ErrorFunc(int Error)
{
    try
    {
        cout << "Error code is " << Error << endl;

if (Error > 0 )
{
throw(Error); // This statement causes control to jump
// to the 'catch' statement
}


        cout << "No Error occoured" << endl;

    }
    catch(int n)
    {
        cout << "Error number is " << n << endl;;
    }
}

On Jul 7, 2005, at 2:33 PM, Jeremy Sagan wrote:

I am trying to link in a library to my project that uses c++ exceptions and now when I link I get undefined errors on symbol __throw and __unexpected. Do I need to link to a c++ library? How do I do it?

Thanks,
Jeremy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Probelms linking shared library
      • From: Asif Jan <email@hidden>
    • Re: undefined __throw
      • From: Jon Guyer <email@hidden>
References: 
 >undefined __throw (From: Jeremy Sagan <email@hidden>)

  • Prev by Date: Re: hosting NSLevelIndicator in a menu
  • Next by Date: Re: undefined __throw
  • Previous by thread: undefined __throw
  • Next by thread: Re: undefined __throw
  • Index(es):
    • Date
    • Thread