Can't run Eric Lyon's book examples

Mar 21, 2013 at 6:12am

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

#67227
Mar 21, 2013 at 10:06am

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

#241931
Mar 21, 2013 at 4:19pm

Hi,

Xcode doesn’t find the “Info.plist” file ; you must set the path in your target settings … but It can be very hard to understand how to (if you are not familiar with Xcode).

In MaxSDK’s examples it is used $(SRCROOT)/../Info.plist ; but for that to work properly you need to based your settings on the “maxmsp.xconfig” file provided by C74 AND that your directory tree remains unchanged.

/ MaxSDK-5.1.7 / examples / Info.plist
/ MaxSDK-5.1.7 / examples / myObjectFolder / myObject.xcodeproj

The number of “..” in “$(SRCROOT) /../../../ Info.plist” is related to branches depth in the directory tree from your folder to a valid plist.

HTH

#241932
Mar 22, 2013 at 3:33pm

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

#241933
Mar 22, 2013 at 4:29pm

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.

#241934
Mar 22, 2013 at 6:42pm

Hi,

The settings of the examples in the SDK are based on “maxmspsdk.xcconfig”. This file defines all search paths for those projects ; that implies that you do not change the directory tree if you work with it (or duplicate a project).

If you change it or if you are in other configuration you should have to edit your own xcconfig (based on the C74′s one) or manually set the search paths ; build a project from scratch is hell for noobs (i have spent weeks on it few years ago) but is a good excercise if you want to manage a more complex project later.

I have no idea how codes are provided with Eric Lyon’s book ; are there any Xcode projects or are they just lonely source codes ?

#241935
Mar 22, 2013 at 8:02pm

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.

#241936
Mar 23, 2013 at 2:39am

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

#241937
Mar 23, 2013 at 7:37am

Hi,

@stringtapper :

(1) It seems that the folder tree is similar to SDK’s one and so it should work with the xcconfig provided ; are you sure your target settings is based on such a xcconfig file ?
(2) There is “macho-prefix.pch” in the SDK-6.1.1 also ; but i never build against it. Have you tried to download the SDK-5.1.7 and compile against it.

(3) Maybe it’s time to contact directly the author.

#241938
Mar 23, 2013 at 8:12am

Hi,

@dhjdhjdhj : Is that :

HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon

properly set in your xcconfig ? Which SDK ?

#241939
Mar 23, 2013 at 5:51pm

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.

#241940
Mar 23, 2013 at 6:41pm

Hi,

If you build against MaxSDK-5.1.7 you should have nothing related to MaxMSP-6.x SDKs ; a mess quickly occurs with trial and error process if you have no idea of what you are doing.

IMHO, go back to the beginning ; download the good SDK (AFAIK Eric Lyon’s book is about max 5) put the “MacOS Projects” folder inside (do exactly what it is write) and build ; there is nothing more to install ; if it doesn’t compile it’s a search path problem (nothing more, nothing less).

But i don’t have nor the book nor the files ; sorry i can not help much more.

#241941
Mar 23, 2013 at 6:55pm

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.

#241942
Mar 23, 2013 at 7:38pm

/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.

#241943
Mar 23, 2013 at 7:51pm

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.

#241944
Mar 23, 2013 at 7:56pm

Adding
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers
to that maxmspsdk.xcconfig file worked for me

#241945
Mar 23, 2013 at 10:38pm

@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.

#241946
Apr 20, 2013 at 7:03pm

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

#241947
Apr 23, 2013 at 6:07pm

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

#241948
May 3, 2013 at 2:48am

I’m having similar problems so, before I try Mr. Lyons method and since I’ve never ever ever used Xcode before, I need to ask even if I feel it’s a really stupid question… How do I install the SDK?

#241949
May 3, 2013 at 7:10am

Hi,
In X Code, I need to comment the #IFDEF part for windows to run the examples correctly.

#241950
Nov 16, 2013 at 4:22pm

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

#271420
Nov 17, 2013 at 3:23pm

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

#271481
Nov 19, 2013 at 6:04am

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.

#271659
Nov 19, 2013 at 7:24pm

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

#271790
Apr 7, 2014 at 9:13am
#285927

You must be logged in to reply to this topic.