Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > framework not found

framework not found
Thread Tools
rrlangly
Fresh-Faced Recruit
Join Date: Oct 2009
Status: Offline
Reply With Quote
Oct 30, 2009, 08:06 PM
 
I'm having a really hard time trying to make two separate projects, one is a dylib, and the other is an application that depends on the dylib. Here's what I have done.

Created a cocoa framework (for my dylib).
Created a cocoa application (which depends on the dylib).
Added a new target of type framework to the dylib project.
In the "Copy Headers" build phase of the framework target, I added all the header files.
The dylib builds successfully and under Products, the "My.framework" font turns black.

I then drag the "Products/My.frameworks" target of the dylib project into "Linked Frameworks" group of the application project.

I drag the "Linked Frameworks/My.framework" file from the app project into the "Copy Files" target of same project, rename "Copy Files" to "Copy Frameworks".

I click "Build and Run" from app project and get these errors.
Code:
ld: framework not found My collect2: ld returned 1 exit status Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
Any help much appreciated.
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 30, 2009, 08:23 PM
 
When you link the framework, make sure the install path in Xcode’s settings is set to something that begins with @loader_path or @executable_path. Read the man page for dyld for details.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
rrlangly  (op)
Fresh-Faced Recruit
Join Date: Oct 2009
Status: Offline
Reply With Quote
Oct 30, 2009, 08:36 PM
 
I guess this is where I'm confused. I added @executable_path/../Frameworks to the Installation Directory under Deployment of the build configuration of my dylib project as found in another tutorial, but it's the app project that can't find it.

My projects dirs look like this ...
Projects
|- MyAppProj
|- MyDyLibProj

I'm trying to better understand how I would package projects up for a release. Hopefully I'm going about it correctly.
( Last edited by rrlangly; Oct 30, 2009 at 08:44 PM. )
     
wadesworld
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Nov 15, 2009, 01:20 AM
 
Use otool -D to see the install_name recorded in the Framework.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:55 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,