Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to include Cg.framework in application



Hi Andrew,

I recently had to do the same thing. I must say, it took me a while to figure out how to do this. I found some info here:

"http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html";

The important part is the following:

"Once your framework target is configured, you can proceed with the modifications to your application target. Your application target needs to know where to find your framework during linking. You must also configure the build phases of your application target to include the framework in the bundle. Finally, you must establish a build dependency between your application and the framework. In your Xcode project make the following modifications to your application target:

  1.

     Add your framework product to the Frameworks & Libraries build
     phase of your application target. This tells the application where
     to find your framework during the link phase.

     Make sure you drag the icon for your framework from the Products
     directory of your project. Dragging the target icon for the
     framework has no effect.

  2.

     Select your application target and choose Project > New Build
     Phase > New Copy Files Build Phase.

  3.

     Open the inspector window for the new build phase.

  4.

     Choose Frameworks in the Destination pop-up menu.

  5.

     Add your framework product to the Copy Files build phase you just
     created.

  6.

     Select your application target and open the inspector window.

  7.

     In the General pane, add your framework to the list of direct
     dependencies for the target. Adding this dependency causes Xcode
     to build your framework target prior to building your application
     target."


Also, make sure you use the latest and greatest version of the Cg Framework (Release 1.3 Beta 2) - because I believe that previous versions of it did NOT have its INSTALL_PATH set as "@executable_path/../Frameworks" like it needs to be - (see the above link for more info on that).


Once this all is working you should be able to use the Finder (or the Terminal prompt) to navigate into "<YourApp>.app/Contents/Resources" and see the Cg Framework sitting there. Once you see that, try this from the Terminal prompt:

otool -L <YourApp.app>/Contents/MacOs/<YourApp>

... you should see that your application is now going to look for the Cg Framework in the bundle instead of the system dirs.

Hope that helps.  I did finally manage to get it working for myself.

-Brian



Date: Sat, 20 Nov 2004 01:58:25 -0600
From: Andrew Schoewe <email@hidden>
Subject: How to include Cg.framework in application
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed

I'm trying to include the Cg.framework into my application bundle so that users can simply copy my application and run it -without the need for the user to download and install the framework. After much effort, I simply can't figure out how to do it. I can get the program to compile when I move the framework folder into the same director as my source code, but when I try and run my program in XCode, I get the following error:

dyld: [program path]/GPUTextures.app/Contents/MacOS/GPUTextures can't open library: /System/Library/Frameworks/Cg.framework/Cg (No such file or directory, errno = 2)

Even though I explicitly set the 'Framework search path' and 'Library search path' to the new location of the Cg.framework folder. It always looks in /System/Library/Frameworks.


Any ideas as to how I can include this framework in Xcode 1.5?


Thanks for any help in the matter,

Andrew



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

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 © 2007 Apple Inc. All rights reserved.