Can't run Eric Lyon's book examples
I can get the examples that come with the Max 6.1.1 SDK to build, but when I try to run the examples from the CD-ROM from Eric Lyon's book (Designing Audio Objects) I keep getting errors like this:
could not read data from '/Users/stringtapper/Programming/MaxSDK-6.1.1/MacOS Projects/oscil~/../../Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
I am an über-noob when it comes to coding so this is probably something very simple I'm missing. I do have the examples folder from the book ("MacOS Projects") in the same directory as the "c74support" folder.
Any ideas from the experienced ones?
Thanks,
Dave
Hey,
I think there are at least two things you could try.
1) copy the plist.info file contained in “MaxSDK-6.1.1/examples“ into your Eric Lyon Xcode project
(drag the file from finder into the Xcode project, and set a check that you want to copy it to the project, not just reference the file)
If this is the only problem, Xcode should find the file and stop complaining.
If this does not work you could also try:
2)duplicate a working Xcode project, remove the code files contained (everything ending with .c) and then copy the code from the examples in the book.
Again use drag and copy. After that you should change the "product name" of your target in the Build Settings to the one you defined with
...class_new("the_class_name")... in the main method of your external.
HTH
Alex
Thanks for you replies guys. I think I have resolved the info.plist issue only to come to another problem.
Now I'm getting these errors:
/Users/stringtapper/Programming/MaxSDK-6.1.1/MacOS Projects/mirror~/
/Users/stringtapper/Programming/MaxSDK-6.1.1/MacOS Projects/mirror~/:3:10: '/Users/stringtapper/Programming/MaxSDK-6.1.1/MacOS Projects/mirror~/../../../c74support/max-includes/macho-prefix.pch' file not found
/Users/stringtapper/Programming/MaxSDK-6.1.1/MacOS Projects/mirror~/:158:2: In file included from :158:
Seems like a similar problem with the project finding certain files, right?
I appreciate any help.
D
One way could be to compare the settings one by one to a project which is working correctly.
If you think a setting in a project from the book is not correct, just copy the entries from the working project. This way you could also get a first glance how the build settings work with max and xcode.
The build settings in xcode do have a s.th like priorities. Means: If you set a setting for the project which is not set explicitly for the target, the target automatically inherits the setting. If you changed a target setting it does not get changed if you tweak the setting in the project settings after. In short, if set specifically the target settings overwrite the project settings.
So if you at the moment only use projects with one target, it should be enough to care about the target settings only and don't worry about the project settings too.
If you are starting to build several targets from one project I of course would not recommend setting it explicitly for every target.
Else I still think it would be easiest to work with a copy of a project which you know is working correctly and just change the code files and rename the "product name" in the build settings.
The book's CD-ROM has a folder called "MacOS Projects" that contains subfolders for different example externals. Those examples indeed have Xcode projects as well as the raw C files. As Lyon instructs in his book, I have put the "MacOS Projects" folder in the same directory as the "c74support" folder that comes with the Max 6.1.1 SDK.
The book is dated 2012. Would there be a problem if the book's examples were based on the Max 5 SDK? The CD-ROM does include a similar "c74support" folder like the one that comes with the SDK.
Thanks for helping this beginner.
I'm trying to run the mirror example (just to get everything configured) but xcode keeps complaining that it cannot find Files.h That file is being included by Ext.h which is part of the Cycling74 headers.
Files.h is on my system, part of CarbonCore and the header file shows up under CoreServices (Actually CoreServices.Frameworks/CarbonCore.framework/Headers), referenced in the xcode project so I'm not sure why I'm getting the compilation error.
Any suggestions?
Thanks
Well I downloaded the Max 5.1.7 SDK in hopes that this would work but now I get this error:
Error: There is no SDK with the name or path '/Developer/SDKs/MacOSX10.6.sdk'
A quick search online suggests this might have something to do with the examples being created in a version of Xcode pre-4.3.
I downloaded and installed the Mac OS 10.6 SDK and installed it at Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ but I still get this error.
Thanks Nicolas. What you suggest is exactly what I did. Re-coped everything from the CD-ROM to eliminate any confusion between the Max 5 and 6 SDKs and yet I'm still getting this error saying that Xcode can't find the Mac OS 10.6 SDK even though it is installed. Even when I change the target to 10.8 and change the lines in the .xcconfig file to 10.8 the error will say that it can't find the Mac OS 10.8 SDK, which is strange since that installs with Xcode itself.
/Developer/..... has not existed for some time in recent versions of xcode
I know where those files live but I assumed that if they showed up in the frameworks as part of the project, they'd be included automatically.
I'm using SDK 6.0.4 with Max 5.1.9
I've built other externals of my own with no problems so I'm sure this is just something stupid.
If you are using Xcode 4.5 or higher it's likely that you don't have the macos 10.6 SDK installed. In your build settings make sure you select a valid Base SDK.
Adding
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers
to that maxmspsdk.xcconfig file worked for me
@Emmanuel: I have installed the 10.6 SDK but I still get the same error no matter which Base SDK I choose in the build settings. I am using Xcode 4.6.1.
Hi All,
Sorry to be late to the party here.
First of all, a big "thank you" to everyone who purchased my book. As I pointed out in the section "The Permanent and the Ephmeral" in Chapter One, the book's information on how to compile your Max projects is the most likely to become obsolete, and that is exactly what happened in the move to SDK 6.1.1 which was not yet available when we went to press.
Anyhow, here's how I solved the problem in OS X.
1) Assume that the old projects on the CDROM are no longer functional. The only useful stuff is the C code for the external.
2) Download and install SDK 6.1.1 (or whatever is current when you are reading this).
3) Test the SDK by compiling an audio object such as lores~
4) Duplicate the lores~ folder and rename it mirror~
5) Copy the code file mirror~.c from my CDROM into the new mirror~ directory
6) Open the lores~ project in the mirror~ folder in Xcode.
7) Remove lores~.c from the project and add mirror~.c
8) Rename the project from lores~ to mirror~ in Xcode.
9) Compile the project, and mirror~ will be built in the upper directory sdk-build
If someone knows an easier way to do this, please feel free to share. Unfortunately I can't help with any upgrade issues associated with Windows.
Eric
On Windows if you just rename lores~.vcxproj
to mirror~.vcxproj
then it is smart enough to update the file reference for you. So just rename the vcxproj file and copy your source file into the folder.
Cheers,
Tim
edited...
Hi,
In X Code, I need to comment the #IFDEF part for windows to run the examples correctly.
I've probably found something wrong. In the test example: building the mirror~ object.
when building in Xcode I'm experiencing errors (that I cant't really understand..I'm a real novice in programming, and I'm blindly following the book instructions)..but I've found out that in the macos folder, the mirror~ project produced a couple of errors on building, and when opening the building report I've found in the ext_proto.h a reference to #ifdef WIN_VERSION, even if I'm on osx.
It's a problem of Xcode???
thanks
Matteo
Unfortunately I can't speak to system-specific difficulties, since there are so many possible permutations. However I did just test the code as it appears on the CDROM of my book in the following manner: replace the c74support folder found on the CDROM with the c74support folder found in MaxSDK-6.1.4. Then, start up Xcode 5.0.2 by double-clicking on the mirror~.xcodeproj project under MacOS Projects. Compile using Project->Build. The resulting external works fine. Tested on OSX 10.9. A few warnings messages are seen, including advice to update to recommended settings. After updating the project, compilation still works fine. You will get a warning that "dsp_add" is deprecated, since the CDROM code is Max5-based, and Max6 is phasing in a new architecture. See the chapter on the CDROM about coding for Max6 to learn how to update code for 64-bit processing.
-Eric
Hi Eric,
Can I suggest that all the CD-ROM examples be kept regularly updated and available for download as a service to those who purchased the book. I just assigned the first example with your 'fix' notes above, and for people who have never used a programming environment, it was a total disaster and I won't do it again. I think they can figure out the code from your well-written book, but stumbling on these environment fixes, as well as having a few minor bugs in the code maybe, is something a regularly updated set of downloads could solve (maybe that would have been the best solution in the first place). If either you or AR could host host these, and have as the top comment the URL to download updates when things die, that would be fantastic. If there is concern about not making these public, perhaps requiring a photo of the cover page for a download code could work. Most technical texts now come with download codes as part of the purchase price.
The book is fantastic, but really needs this, imho. Please advise if this is a possibility--I know you have just moved to new digs, but perhaps AR can give you space to keep their book relevant.
Hi Jeffrey,
Thank you for your comments and suggestions. You raise an important point that I would like to address.
Can I suggest that all the CD-ROM examples be kept regularly updated and available for download as a service to those who purchased the book.
Much as I would like to do so, this is simply not practical. There are three OSes to support, Windows, OSX, and Linux. I only run OSX. Then, OSX and Xcode are a moving target. It's part of the territory that these environments change, and learning to deal with API changes is part of developing one's skill as a programmer.
I realize it's frustrating when you want to dive into coding, and the environment puts up a major roadblock. I get frustrated too. Recently when Xcode 5 was released, all of a sudden, none of my Max projects would compile. Then, after not too long a time, Cycling '74 released a new SDK, and everything works again. For now. On OSX 10.9.
I made it quite clear in my book that I expected the guidance on compiling in various programming environments to become obsolete rather soon. That information has a very short shelf-life. I believe that the real long-term value in my book is in its narrative on coding practice, and the Max code itself. I hope readers think so too in a few years!
I just assigned the first example with your ‘fix’ notes above, and for people who have never used a programming environment, it was a total disaster and I won’t do it again.
I'm not sure I fully understand this. The fix I posted was quite simple - swap in the new SDK, and all of the examples on the CDROM (somewhat amazingly!) will compile under Xcode 5. So that's one example of post-publication support from the author. At the same time, for anyone who has never used a programming environment, there are so many ways to experience total disaster that I am not surprised by your report. But that is where a teacher, such as yourself, can make a big difference.
I realize that my response may not be fully satisfying, but it is necessary for me to establish some boundaries on past work, in order that I can move forward on other coding and writing projects that will hopefully be more useful to the Max community than writing endless tutorials on how to compile code in Xcode version ???, gcc version ???, and Visual Studio version ???.
Let me propose another solution. The CDROM on my book is covered under the MIT Licence, with the exception of Cycling '74's intellectual property. So any of my code and projects can be altered and redistributed by anyone. And anyone, at any time can produce new projects for any of the code and distribute this work themselves, or can send it to me for posting on my website.
Finally, I am very grateful to everyone who has purchased a copy of my book, and I hope that each reader will find the book of lasting value in supporting their own growth and creativity. At the same time, I have my own limitations, which I hope seem reasonable.
-Eric
Slight update to this conversation. Please see:
-Eric
Hello Eric, if you are here…
failed miserably with Xcode and SDK and blah blah..
very frustration…
anyway, so I thought I'd run the process in PD.
here's what it return trying to make mirror~
I want my money back!!!!!!!!!
Thank you
Stefanos-MacBook-Pro:oscil~ stef$ cd /Applications/Pd-extended.app/Contents/Resources/extra/mirror~
Stefanos-MacBook-Pro:mirror~ stef$ ls
makefile mirror~.c
Stefanos-MacBook-Pro:mirror~ stef$ make
cc -arch i386 -arch ppc -DPD -g -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch -I../../src -o mirror~.o -c mirror~.c
clang: warning: not using the clang compiler for the 'powerpc' architecture
mirror~.c:96:27: warning: unused parameter 'x' [-Wunused-parameter]
void mirror_dsp(t_mirror *x, t_signal **sp, short *count)
^
mirror~.c:96:52: warning: unused parameter 'count' [-Wunused-parameter]
void mirror_dsp(t_mirror *x, t_signal **sp, short *count)
^
2 warnings generated.
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
clang: error: gcc frontend command failed with exit code 255 (use -v to see invocation)
make: *** [mirror~.d_fat] Error 255
Stefanos-MacBook-Pro:mirror~ stef$
Hi,
You should remove -ppc (powerpc) with the last version of llvm.
It's hard to locate the problem without any system info or details on what went wrong with Xcode/SDK. You should in any case be running the latest OSX and Xcode (currently OSX 10.9.x and Xcode 5.x). Then the update I posted above on April 7 should work for Max/MSP.
Pd can be a rougher ride, but that's not too hard to fix either. The original code from the book still compiles fine on Pd, but you do need an updated makefile to install in the "extra" directory. I have linked a makefile I just tested against Pd-0.45-5.
HTH,
Eric
Thanks Eric, I was just needing that update makefile for Pd!
Digging into your book at last,
Shawn