• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Building framework with another framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building framework with another framework


  • Subject: Re: Building framework with another framework
  • From: Ryan Homer <email@hidden>
  • Date: Mon, 7 Jan 2008 13:53:30 -0500

  1. Yes you are supposed to type @executable_path exactly like that; it will be replaced by the dynamic library loader at runtime.
  2. If your .h file is not copying over, it might be set as type "Project" and not as "Public".
  3. In some cases, you do indeed want to look for your libraries in @executable_path/Frameworks, but in other cases, you need to check in @executable_path/Frameworks/CCILib.framework/Versions/Current/Frameworks in order to find the MAAEL.framework. You may need to create a soft link from the first Frameworks directory so that MAAEL.framework also appears to be a sub-directory of it.
  4. I notice that one of the errors is "@executable_path/../Frameworks/MAAEL.framework/Versions/A/MAAEL" which seems to confirm #3.

On 7-Jan-08, at 12:59 PM, Steve Mills wrote:

I have 2 frameworks that I'm building, one depends on the other. Framework A is a C++ Apple Event sender/receiver wrapper. Framework B contains some custom functions for a customer - it just sends some Apple Events to our app, and it builds those events with the API defined in framework A.

I found the "Creating a Framework" doc in the Framework Programming Guide. The section titled "Embedding a Private Framework in Your Application Bundle" explains how to embed a private framework into an app, but I need to first embed A into B. This is possible, yes? Step 2 says to "Set the value of the Installation Directory build setting to @executable_path/../Frameworks." Is "@executable_path" supposed to be typed as-is, or is it a documentation placeholder for "the path that your framework's executable is located at"?

In the project for A, I also have another target that's an application for testing the framework. I've done everything explained in the doc, and it seems to be working correctly. Project B also has a test app target for testing framework B. I've done the same thing to it so it knows how to copy and link against framework B. However, I get a bunch of link errors when building test app B (for clarity below, framework A is actually named MAAEL.framework, and framework B is named CCILib.Framework):

Building target “TestApp” of project “CCILib” with configuration “Debug” — (1 error)
   cd "/depot/8.0.x/creatortech/desktop/mac/CCI Lib"
   /Xcode2.5/usr/bin/g++-4.0 -o /depot/8.0.x/creatortech/desktop/mac/MAAEL/build/Debug/TestApp.app/Contents/MacOS/TestApp -L/depot/8.0.x/creatortech/desktop/mac/MAAEL/build/Debug -F/depot/8.0.x/creatortech/desktop/mac/MAAEL/build/Debug -filelist /depot/8.0.x/creatortech/desktop/mac/MAAEL/build/CCILib.build/Debug/TestApp.build/Objects-normal/i386/TestApp.LinkFileList -framework CoreFoundation -framework CCILib -framework Carbon -arch i386 -Wl,-Y,1455 -mmacosx-version-min=10.4 -framework Carbon -isysroot /Xcode2.5/SDKs/MacOSX10.4u.sdk
/Xcode2.5/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning can't open dynamic library: @executable_path/../Frameworks/MAAEL.framework/Versions/A/MAAEL referenced from: /depot/8.0.x/creatortech/desktop/mac/MAAEL/build/Debug/CCILib.framework/CCILib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/Xcode2.5/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
HGetAndLock(char**) referenced from CCILib expected to be defined in @executable_path/../Frameworks/MAAEL.framework/Versions/A/MAAEL
HReset(char**, char)referenced from CCILib expected to be defined in @executable_path/../Frameworks/MAAEL.framework/Versions/A/MAAEL
fAEReceiver::GetDataType(unsigned long, unsigned long*, short)referenced from CCILib expected to be defined in @executable_path/../Frameworks/MAAEL.framework/Versions/A/MAAEL

etc...

This is what the built framework B looks like in Finder:

CCILib.framework
CCILib (link)
PkgInfo
Resources (link)
Versions
A
CCILib
Frameworks
MAAEL.framework (everything in here looks correct)
Resources
Current (link)

Note that the Headers folder is not being created, even though it has a Copy Headers build phase and the 1 .h file that should be copied is in that phase. I don't remember how I finally got this to work in framework A.

I'm very confused at this point, and having a cold doesn't help with my clarity. :(

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/

 _______________________________________________
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

References: 
 >Building framework with another framework (From: Steve Mills <email@hidden>)

  • Prev by Date: error "Command /Developer/usr/bin/gcc-4.0 failed with exitcode 1"
  • Next by Date: Re: Xib localization
  • Previous by thread: Building framework with another framework
  • Next by thread: Re: Building framework with another framework
  • Index(es):
    • Date
    • Thread