• 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: Wayne Hasley <email@hidden>
  • Date: Thu, 07 Jul 2005 16:41:39 -0700




From: Wayne Hasley <email@hidden>
TO: Jeremy Sagan <email@hidden>
CC:
Date: Thu Jul 07, 2005 05:38:10 PM PDT
Subject: Re: undefined __throw

Jeremy

Look at the command line you're using to build the program.

The comment in the code says to type:
         g++ -fhandle-exceptions throw.cc -o throw

>From the error you're getting, I'd guess that you didn't type the -o throw part of the command line.

I get:
      g++ -fhandle-exceptions throw.cc -o throw
      cc1plus: warning: -fhandle-exceptions has been renamed to -fexceptions (and is  now on by default)

Wayne



On Thursday, July 07, 2005, at 04:19PM, Jeremy Sagan <email@hidden> wrote:

>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
>
>

 _______________________________________________
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

References: 
 >undefined __throw (From: Jeremy Sagan <email@hidden>)
 >Re: undefined __throw (From: Jeremy Sagan <email@hidden>)

  • Prev by Date: Re: undefined __throw
  • Next by Date: Using gdb in Xcode
  • Previous by thread: Re: undefined __throw
  • Next by thread: Probelms linking shared library
  • Index(es):
    • Date
    • Thread