Re: Native ObjC exception problem.

"Mehul N. Sanghvi" <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Message-ID <[email protected]>
Sašo Kiselkov said the following on 8/24/2005 7:18 AM:
> Hi.
> 
> I'm using gcc 4.0.1 (latest Debian package) and I get the following error when
> trying to compile a tool that uses the native (@try{}@catch{...}...) exceptions
> model in Objective-C:
> 
> Making all for tool test...
>  Compiling file test.m ...
>  Linking tool test ...
> ./shared_obj/test.o:(.gnu.linkonce.d.DW.ref._OBJC_CLASS_NAME_4[DW.ref._OBJC_CLASS_NAME_4]+0x0):
> undefined reference to `_OBJC_CLASS_NAME_4'
> collect2: ld returned 1 exit status
> make[1]: *** [shared_obj/test] Error 1
> make: *** [test.all.tool.variables] Error 2
> 
> The funny thing is I get it only when I actually use @try{}, but if I just
> @throw an object it works, compiles nicely a makes the tool abort() (since the
> exception isn't handled).
> Do I need to upgrade to gcc 4.1 or can I cut out the libobjc 4.1 out of it in
> some way? I'd like to avoid making a completely new gcc 4.1, since I have a
> rather slow computer and compiling it would take days.
> 
> Regards
>  Saso
> 


Saso,

    According to http://gcc.gnu.org/gcc-3.4/changes.html#3.4.4

The Objective-C front end has been updated to include the numerous bug 
fixes and enhancements previously available only in Apple's version of 
GCC. These include:

     * Structured exception (@try... @catch... @finally, @throw) and 
synchronization (@synchronized) support. These are accessible via the 
-fobjc-exceptions switch; as of this writing, they may only be used in 
conjunction with -fnext-runtime on Mac OS X 10.3 and later. See Options 
Controlling Objective-C Dialect for more information.


    1.  Is the makefile passing the -fobjc-exceptions and -fnext-runtime
        switches to gcc ?

    2.  Are you on MacOSX 10.3 or above ?  (This is a no, based on your
        the fact that you are using Debian).


That's about the end of my knowledge for Objective-C.  I know you are
using 4.0.1, but when looking at the changes for 4.0.1 there was no
mention of any more improvements to @try or if you could use it on
non-MacOSX systems.  Neither is there a mention of it in 4.1, so you'd
be wasting time trying to build it :)

Hope this helps.


cheers,

      mehul



-- 
Mehul N. Sanghvi
email: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.