Skip to topic | Skip to bottom

You are here: ProductDocumentation > MaxUBSDK > MoreAboutFrameworks
ProductDocumentation.MoreAboutFrameworks r1.1 - 05 Apr 2006 - 00:40 - DavidZicarelli topic end


Start of topic | Skip to actions

More About Frameworks

Frameworks are an Apple name for shared libraries optionally packaged with header files. The use of Frameworks in a project replaces the old "MaxLib.stub" type files in CFM external objects.

There are four Max-related frameworks files that must be included in your external object project and be enabled for the Target you are building. If you are building any Max external, you need MaxAPI.framework.

If you are building an external object that works with MSP, you need both MaxAPI.framework and MaxAudioAPI.framework.

If you are building a Jitter object, you will need MaxAPI.framework and JitterAPI.framework (distributed with the forthcoming Mach-O Jitter SDK). If your Jitter object also deals with audio, you'll need MaxAudioAPI.framework too.

If you are writing an external object that works with Javascript, include MaxJSRef.framework, which you can obtain from inside the Frameworks folder inside the Max application bundle.

To add a framework to your project, click on the folder called External Frameworks and Libraries on the left side of your object's project window. Then choose Add To Project... from the Project menu. Navigate to /Library/Frameworks and choose the desired framework.

Using Framework Headers

Instead of manually including files such as "ext.h" and "z_dsp.h" in your source code, you can add a line to your project's prefix file to include the headers for MaxAPI.framework and MaxAudioAPI.framework. This might be slightly faster since the header files will be precompiled. However, if you are interested in cross-platform source compatibility, you may not want to do this, since prefix header files are not really supported by Visual C++ on Windows.

The prefix header files used by the SDK's example projects are called max_sdk_macho_prefix.pch, located in the max-includes folder inside the c74support folder. They simply say this:

#include <Carbon/Carbon.h>
This means, "Include the header file Carbon.h inside the Carbon framework."

To include the Max headers, you can add, logically enough:

#include <MaxAPI/MaxAPI.h>
To include the MSP headers, add:
#include <MaxAudioAPI/MaxAudioAPI.h>
One advantage of doing this is that if you store the prefix header file inside your project folder, you don't need to use the folder structure we've used in the SDK, because the reference to uses the Frameworks search path, which is global to your entire computer.

Again, consider whether cross-platform source is important when deciding whether this style of header file inclusion suits you.

The Framework Install Path

One major change between Max 4.5 and Max 4.6 is how frameworks are used. Max 4.6 introduces the concept of private frameworks located inside the application bundle rather than in /Library/Frameworks, while Max 4.5 relied on frameworks in /Library/Frameworks. The only problem with private frameworks is that you can't use them to build external objects, so that's why we request that you copy the frameworks included in the SDK to this location.

The private frameworks feature allows Max users to develop standalone applications that are completely self-contained -- they will run on any Mac without needing to install frameworks or other libraries.

The frameworks in the SDK are identical, except for internal bug fixes, to the frameworks inside the currently shipping version of the application. These frameworks have a special Install Path that allows them to work either in /Library/Frameworks or inside the application's private frameworks folder. In order for your external object to find the libraries inside of the MaxAPI.framework and MaxAudioAPI.framework when they are located inside the application, they must link with frameworks containing the special install path.

This would not be important except for the fact that before you copy the frameworks in the SDK to /Library/Frameworks, you may have the 4.5 versions present. It's important to overwrite these old versions with the SDK frameworks, so that your external can find the libraries it needs inside the application.

Next: Making Xcode Install Your Object

Return to the Max/MSP Universal Binary SDK Table of Contents

-- DavidZicarelli - 05 Apr 2006
to top

-->

You are here: ProductDocumentation > MaxUBSDK > MoreAboutFrameworks

to top

Copyright © 2007 Cycling '74. All Rights Reserved.

...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT... porn free porn