Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Annoying compiler warnings (repost)



This is very definitely a nonsense. A header can NEVER EVER have this
result(*): even if it contains "unresolved" declarations, they would not
cause link problems when not actually used.

The problem would be elsewhere: you _CAN_ import _ANY_ header, and all will
work properly. The @class directive is needed for cross-refs only (when class
A refs class B, which refs class A, so that you can't just import A.h to B.h
and B.h to A.h for obvious reasons).

Well, just thought I'd let everybody know that I cleared up my "nonsense" with a bit of help from these e-mails.

There weren't any cross-references present, all that was happening was that me, being the fool that I am, decided to import a header with functions I'd created from within one of my class' header file. So, the link error was telling me that there were multiple definitions of a symbol.

Well, it all makes sense now, but still, none of this #import stuff is very clear to me. Thankfully, I now have some guidelines I can follow, which makes it just a wee bit clearer.

Special thanks go to Ondra who didn't believe that what happened could have happened :)

-- Rob

TINRA - There Is No Right Answer




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.