Re: Importing framework include files
Re: Importing framework include files
- Subject: Re: Importing framework include files
- From: "R.L. Grigg" <email@hidden>
- Date: Wed, 14 May 2008 13:35:56 -0700
On May 14, 2008, at 12:21 PM, Chris Espinosa wrote:
On May 14, 2008, at 12:01 PM, R.L. Grigg wrote:
In a Cocoa project (OSX 10.5.2, Xcode 3.0) when I add a framework
from /Library/Frameworks into the project "Linked Frameworks" group
how do I then reference one of the frameworks include files from my
code?
Using either #import "name.h" or #import <name.h> comes up with "No
such file or directory". Doesn't adding a framework cause Xcode to
automatically add the Headers subfolder in it's -I search path for
includes?
No, it doesn't add the path to the framework's Headers folder to the
-I (include file directory) list to the compiler, it adds the path
to the framework proper to the -F (framework directory) list to the
compiler.
You need to use framework-style includes, that is <framework/
header.h> to refer to header files in frameworks.
Okay, I'm still doing something wrong since I still get the error
using framework-style includes.
My project is "NetHub" and I use a framework called "NetHubPorts".
% ls -l /Library/Frameworks/NetHubPorts.framework/Headers
lrwxr-xr-x 1 russ staff 24 Apr 14 12:40 /Library/Frameworks/
NetHubPorts.framework/Headers -> Versions/Current/Headers
% ls -l /Library/Frameworks/NetHubPorts.framework/Versions/Current/
Headers
total 24
-rw-r--r-- 1 russ staff 14039 Apr 14 12:40 NHPMultiPort.h
-rw-r--r-- 1 russ staff 12849 Apr 14 13:03 NHPPort.h
-rw-r--r-- 1 russ staff 10282 Apr 14 12:40 NHPSingletPort.h
In my code, I have this in my NetHubCtrlr.h file:
#import <NetHubPorts/NHPPort.h>
Here is the compile:
CompileC build/NetHub.build/Debug/NetHub.build/Objects-normal/ppc/
NetHubCtrlr.o /Users/russ/projects/NetHub/NetHubCtrlr.m normal ppc
objective-c com.apple.compilers.gcc.4_0
cd /Users/russ/projects/NetHub
/Developer/usr/bin/gcc-4.0 -x objective-c -arch ppc -pipe -Wno-
trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-
variable -fmessage-length=0 -mtune=G5 -mfix-and-continue -mmacosx-
version-min=10.5 -gdwarf-2 -I/Users/russ/projects/NetHub/build/
NetHub.build/Debug/NetHub.build/NetHub.hmap -F/Users/russ/projects/
NetHub/build/Debug -I/Users/russ/projects/NetHub/build/Debug/include -
I/Users/russ/projects/NetHub/build/NetHub.build/Debug/NetHub.build/
DerivedSources -isysroot /Developer/SDKs/MacOSX10.5.sdk -include /
Library/Caches/com.apple.Xcode.502/SharedPrecompiledHeaders/
NetHub_Prefix-ergzbrbydajfirbwthvwwgmofaob/NetHub_Prefix.pch -c /Users/
russ/projects/NetHub/NetHubCtrlr.m -o /Users/russ/projects/NetHub/
build/NetHub.build/Debug/NetHub.build/Objects-normal/ppc/NetHubCtrlr.o
In file included from /Users/russ/projects/NetHub/NetHubCtrlr.h:14,
from /Users/russ/projects/NetHub/NetHubCtrlr.m:9:
/Users/russ/projects/NetHub/NetHubCtrlr.h:11:22: error: NHPPort.h: No
such file or directory
Thx,
Russ
_______________________________________________
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