[ann] Max C++ templates updated for Max 5
Jun 3, 2009 at 5:28am
[ann] Max C++ templates updated for Max 5
I’ve just uploaded updates to the MaxC++ templates, now working with the Max 5 SDK (sorry for the delay)
The Max 5 SDK was much easier to write for, and the templates are now quite a bit smaller, which is nice.
Any ideas, fixes, breakages, etc welcome
Sep 4, 2009 at 11:29am
Now trying with the example code I’ve found in this very useful page I found a similar error. I’m not able to understand where is the problem. I’ve not big problem with C++ programming but is the first time for me programming for an External Object, so maybe the solution is very easy. I’m just blind.
Can we try to understand why I’m not able to compile the example code:
The errors are in a snapshot attached in tiff format.
Hope we can understand where is the problem.
Sep 4, 2009 at 3:43pm
The path to macho-prefix.pch is wrong. You should be able to set this in your target settings somewhere.
Sep 4, 2009 at 5:03pm
Those MaxMSP C++ templates should be dropped into the MaxSDK folder, then all the patchs should match up. That is, the ‘maxcpp5′ folder should be at the same level as the ‘c74support’ folder.
If you put them anywhere else, you’ll need to adjust the various include and framework paths etc.
Sep 7, 2009 at 10:13am
Thank you all. Now is compiling with no errors.
The problem I have now is that also after compiling I can’t find the .mxo. It is not in the build directory (I can see just a link) and is red in XCode project.
Why it happens?
Maybe I need another topic?
ps. screenshot in attach
Sep 7, 2009 at 3:36pm
Yes, you should have started a new topic, since this is completely tangential to the original post. But I’m replying to the same thread anyway.
For reasons which I don’t recall at the moment, the XCode template for .mxo’s puts Debug builds into …/xcodebuild/UninstalledProducts/ (relative to the Project directory), rather than …/xcodebuild/Development (where it deposits an Alias to your .mxo).
You have a couple of choices: you can add the UninstalledProducts/ directory to your Max search path (in Max use the File Preferences… dialog from the Options menu); you could move the UninstalledProducts/ directory to inside your existing Max search path (and update all of your .xcodeprojects, obviously a pain to do); or you can double-click on your .mxo (which is equivalent to using the Install… command from Max/MSP’s File menu).
There is another sensible and convenient alternative that Max/MSP unfortunately refuses to support: from Max 2.x up to Max 4.x it was possible to put an Alias to the UninstalledProducts/ directory into the Max search path, and the UninstalledProducts/ directory itself would be included in the search path. No go since Max 5.0. Cycling ’74 has responded inflexibly about this since I lodged one of the first bug reports on the subject 18 months ago. But it couldn’t hurt if more people complained.-
Sep 7, 2009 at 4:15pm
If you’re using the C++ templates, then they are putting the mxo’s two folders up in the directory, and into a folder called sdk-build/. The assumption being that the maxcpp5 folder was placed in the MaxSDK folder at the same level as c74support, examples, etc., thus the products will be in the same place as all the other examples put their products.
If you right-click on the alias which is in the build folder, and select ‘Show Original’, it will show you where it was installed.
As Peter says, it can be a good idea to add this output folder to your Max search path; in this case, the path to /sdk-build folder in the MaxSDK folder (wherever you put that).
But if your products are showing up red in Xcode, it looks they didn’t build…? Wait; it looks on your tiff that the products have a locked symbol on them – is this a permissions issue? Is your SDK in a place where you don’t have permissions to copy?
Sep 7, 2009 at 4:43pm
Thanks all (and sorry for the outoftopic, but now is long to post everything in another new topic…it will never happen again. I promise).
I’ve found the object in the /sdk-build folder. Seems to be a fake object. And yes, they are RED in Xcode.
I’ve changed directory of the project putting everything in my home (to be sure there are not problem with permissions), but is always the same. It happens using the example maxcpp5. The mxo remains locked.
Thanks for your precious help.
Sep 8, 2009 at 2:56am
Yeah… I don’t know how to help you on this. I just checked to be sure there aren’t any hard-coded paths etc. in the projects, but they’re all fine as far as I can tell.
Here’s what I would recommend:
Download the SDK, put it in your user Documents folder.
E.g. Macintosh HD/Users/yourname/Documents/MaxSDK-5.0.6
Download the templates, and put them in the MaxSDK-5.0.6 folder.
So the Xcode project should now be at
The built product should be at
That works for me; OS 10.5.8, Xcode 3.1.2.
If you still have locked files, maybe it’s time to do a repair permissions on your disk? Dunno…, sorry
Sep 10, 2009 at 8:36pm
The templates are great, but I can’t figure out setup methods for incoming floats and ints. I’ve tried everything I can think of from C external programming, and none of those are working. A really simple int method would be awesome, if you get a chance. I have a feeling that it will be embarrassingly simple, so I apologize in advance.
Also, once that’s set up, I assume it’s best to determine inlet in the function?
Thanks for your help,
Feb 14, 2010 at 5:29pm
My C++ skills aren’t great. Could someone confirm that Mr. Wakefield’s templates only support A_NOTHING and A_GIMME methods? No support for A_INT and A_FLOAT, correct?
Feb 15, 2010 at 8:42pm
Yes, in the templates only A_NOTHING and A_GIMME methods are supported. You can use A_GIMME to grab int and float values of course!
But, if you really want to use A_FLOAT or A_INT, you would need to add macros to maxcpp.h:
And add to the MaxCpp class:
Then in your own class, you can add methods like this:
And register them in main() like this:
I’ll add this to the next version of the templates – will update it soon.
Feb 15, 2010 at 11:04pm
Thanks so much for this! Your template is really nice, just a thin layer. Took me all of an hour and a half to port a VST to a msp external.
Studying Stroustrup now, and hope to understand templates real soon.
Best wishes, Charles
You must be logged in to reply to this topic.