views:

65

answers:

2

I copied the EyeTunes framework into my project and it says that is not declared.

In the original project I go to definition and it takes me to AEDataModel.h where it is defined.

However in my project it doesn't do that and it's not found. How do I add AEDataModel to my project?

EDIT: The error just says typeInteger undeclared. I included it at the top of the file which it says it's undeclared in, as well as my main application class.

Build listener of project listener with configuration Release

CompileC build/listener.build/Release/listener.build/Objects-normal/x86_64/ETAppleEventObject.o eyetunes/ETAppleEventObject.m normal x86_64 objective-c com.apple.compilers.gcc.4_2
cd /Users/Chris/Projects/MyProj/listener
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch x86_64 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O3 -mdynamic-no-pic -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.5.sdk -fobjc-gc-only -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/MyProj-generated-files.hmap -I/Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/MyProj-own-target-headers.hmap -I/Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/MyProj-all-target-headers.hmap -iquote /Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/MyProj-project-headers.hmap -F/Users/Chris/Projects/MyProj/listener/build/Release -F/Users/Chris/Projects/MyProj/listener -F/Users/Chris/Projects/MyProj/listener/eyetunes/build/Debug -I/Users/Chris/Projects/MyProj/listener/build/Release/include -I/Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/DerivedSources/x86_64 -I/Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/DerivedSources -include /var/folders/D0/D0UlcUoHGnWkhpryEbl-Fk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/listener_Prefix-cdtjvrvgcrzzofajlzrpluujglat/listener_Prefix.pch -c /Users/Chris/Projects/MyProj/listener/eyetunes/ETAppleEventObject.m -o /Users/Chris/Projects/MyProj/listener/build/listener.build/Release/listener.build/Objects-normal/x86_64/ETAppleEventObject.o

/Users/Chris/Projects/MyProj/listener/eyetunes/ETAppleEventObject.m: In function '-[ETAppleEventObject getPropertyAsIntegerForDesc:]':
/Users/Chris/Projects/MyProj/listener/eyetunes/ETAppleEventObject.m:757: error: 'typeInteger' undeclared (first use in this function)
/Users/Chris/Projects/MyProj/listener/eyetunes/ETAppleEventObject.m:757: error: (Each undeclared identifier is reported only once
/Users/Chris/Projects/MyProj/listener/eyetunes/ETAppleEventObject.m:757: error: for each function it appears in.)

Thanks

A: 

AEDataModel.h is part of the AppleEvents framework (AE.framework), which is itself a sub-framework of either the CoreServices.framework (/System/Library/Frameworks/CoreServices.framework) or the ApplicationServices.framework (/System/Library/Frameworks/ApplicationServices.framework) umbrella frameworks, depending on what version of OS X you're running. (AE.framework was moved under CoreServices.framework in more recent versions of Mac OS X like 10.5 and later).

ApplicationServices.framework can be thought of as slightly "higher-level" than CoreServices.framework; to that end, the ApplicationServices.framework actually includes CoreServices.framework as part of its feature set.

Adding ApplicationServices.framework to your project and linking against it for the target in question should be sufficient. To do that, right-click (Control-click) in the Groups & Files outline view, and choose Add > Existing Frameworks…. In the dropdown sheet that appears, select ApplicationsServices.framework and click Add.

Hope this helps....

NSGod
I've added ApplicationServices.framework and still no luck. What's weirder is that I removed ApplicationServices.framework from the sample EyeTunes project and it STILL compiles for some reason.
Chris
I fixed the problem by subbing typeInteger with typeSInt32, which is what it is defined as when I click jump to definition in the sample EyeTunes project.If you know what's wrong though please let me know.Thanks!
Chris
A: 

You need to #include <ApplicationServices/ApplicationServices.h>.

Note that typeInteger and a bunch of others are only available on 32-bit. If you want to target 64-bit, you'll have to change old code to use the newer constants. See the AEDataModel.h header for further information.

Peter Hosey
I added that. While I can now jump to definition and typeInteger is now highlighted, it still doesn't compile. Same error.
Chris
You haven't actually given us the exact error message, so please edit that into your question. Also make sure you `#include`d the header in the right place; I'd just put it into the prefix header.
Peter Hosey
All it says is typeInteger undeclared.
Chris
That's not the exact error message. Please edit the exact error message as given by the compiler into your question.
Peter Hosey
Okay I added in more info. Is that the exact error message? Sorry first time using xcode.
Chris
Chris: That's the build operation, compiler environment, compiler command line, and error messages. Anyway, see what I just added to my answer.
Peter Hosey