Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Problem with compiler directives
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with compiler directives



So, I have this NSToolbarDelegate class that is used both to compile ppc, i386 and x86_64.

In my deployment configuration, I have the SDKROOT defined with a build setting condition:

x86_64 = macosx10.6
i386 = macosx10.5
ppc = macosx10.5

Now, when I build and omit the <NSToolbarDelegate>, when the compiler compiles the x86_64, it complains with a warning that my ToolbarController doesn't implement protocol "NSToolbarDelegate".

So, to get around this annoying warning, I did this in my ToolbarController.h file:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
@interface ToolbarController : NSObject <NSToolbarDelegate>
#else
@interface ToolbarController : NSObject
#endif

I'm obviously missing something because when the compiler compiles the ppc binary, it gives me an error that it can't find protocol NSToolbarDelegate:

/Developer/usr/bin/gcc-4.2 -x objective-c -arch ppc -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -mdynamic-no-pic -Wreturn-type -Wunused-variable -Wshorten-64-to-32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mtune=G4 -fvisibility=hidden -Wno-deprecated-declarations -mmacosx-version-min=10.5 -gdwarf-2 "-I/Users/laurent/Documents/Development/Personal/MyApp/build/MyApp.build/Deployment/MyApp.build/MyApp.hmap" "-F/Users/laurent/Documents/Development/Personal/MyApp/build/Deployment" "-I/Users/laurent/Documents/Development/Personal/MyApp/build/Deployment/include" "-I/Users/laurent/Documents/Development/Personal/MyApp/build/MyApp.build/Deployment/MyApp.build/DerivedSources/ppc" "-I/Users/laurent/Documents/Development/Personal/MyApp/build/MyApp.build/Deployment/MyApp.build/DerivedSources" -include "/var/folders/gd/gdjJUItFGEanPbrHkxIma++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/MyApp_Prefix-auqbsecqfprubwfiblsjzccbseel/MyApp_Prefix.pch" -c "/Users/laurent/Documents/Development/Personal/MyApp/Classes/ToolbarController.m" -o "/Users/laurent/Documents/Development/Personal/MyApp/build/MyApp.build/Deployment/MyApp.build/Objects-normal/ppc/ToolbarController.o"

In file included from /Users/laurent/Documents/Development/Personal/MyApp/Classes/ToolbarController.m:52:
/Users/laurent/Documents/Development/Personal/MyApp/Classes/ToolbarController.h:58: error: cannot find protocol declaration for 'NSToolbarDelegate'

What am I missing?

-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 				http://www.nemesys-soft.com/
Logiciels Nemesys Software              			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



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.