AUs in Xcode


#1

Since Apple keep messing about with their tools and breaking AU support, this is a sticky thread that will be kept up to date with the latest info on this subject.

Here’s a link to the current best practice on installing the Apple AU files:
http://rawmaterialsoftware.com/viewtopic.php?f=8&t=9546&p=56679#p56677

And here’s Apple’s official link to the place to get the AUPublic files:
https://developer.apple.com/library/mac/samplecode/CoreAudioUtilityClasses/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012328


Rez error in Xcode
#2

Using the new AU libs (10.7), Apple states that backward compatibility should be easily possible by simply keeping the AUResources file in place.

This doesn’t seem to be the case however.

I would be very interested to know if anyone finds a way to compile a plugin with 10.7 libs that will run on a 10.6 machine.

Thanks!


#3

Thanks was really struggling with this. Following these instructions I’ve had success on:
-OS X 10.8
-Xcode 4.6
-Core Audio Utility Classes - Version 1.0.3, 2013-01-02


#4

I’m having some issues in the latest Juce (b2e8db097a) and XCode 4.6.1 building the Juce Demo Plugin AU in Mac OS X 10.8.3. There are now 3 expected “{” errors in the Juce AU wrapper (seemingly for no good reason.) Anyone else experiencing this? I’ve tried the latest 2 patched versions of the CoreAudio classes linked to in this thread (which were working with previous Juce versions.)


#5

Hi,

for some strange reasons I cannot compile AU plugins anymore thought I haven’t changed
anything in the CoreAudio classes. I am on Xcode 4.5.2 and just downloaded the latest modules using IntroJucer.
Since I did that I get the below linker errors (at least I can’t remember having this problem before…)

May some of the linker experts can help me out here?

It’s much appreciated!
Joerg

Ld /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Products/Debug/VCommanderVST_debug.component/Contents/MacOS/VCommanderVST_debug normal i386
    cd "/Eigene_Dateien/VST_Development/Eigene Projekte/VCommander/VST/Builds/MacOSX"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -bundle -L/Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Products/Debug -F/Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Products/Debug -filelist /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/VCommanderVST_debug.LinkFileList -bundle -fobjc-link-runtime -framework Accelerate -framework AudioToolbox -framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreAudioKit -framework CoreMIDI -framework DiscRecording -framework IOKit -framework QuartzCore -framework WebKit -o /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Products/Debug/VCommanderVST_debug.component/Contents/MacOS/VCommanderVST_debug

duplicate symbol __ZN12AUMIDILookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN12AUBaseLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN14AUOutputLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN21AUComplexOutputLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN19AUBaseProcessLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN27AUBaseProcessMultipleLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN19AUMIDIProcessLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
duplicate symbol __ZN13AUMusicLookup6LookupEs in:
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/AUPlugInDispatch.o
    /Users/FinalFanta54321/Library/Developer/Xcode/DerivedData/VCommanderVST-bhdxstokztnbkggkvdadquievkby/Build/Intermediates/VCommanderVST.build/Debug/VCommanderVST.build/Objects-normal/i386/juce_AU_Wrapper.o
ld: 8 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

#6

Well, finally I am a step further here.

I now can successfully built AU. What I’ve done so far was:

  • upgraded to Xcode 4.6.2
  • done these steps: http://rawmaterialsoftware.com/viewtopic.php?f=8&t=9546&p=56679#p56677
    (Shame that we have to do Apples home work!!!)
  • downloaded bleeding edge (using git clone --depth 1 git://juce.git.sourceforge.net/gitroot/juce/juce)
    (Just updating juce modules using Introjuser didn’t work for me here)
  • deleted all derived data
  • rebuilt Introjucer
  • re-saved my project files using introjucer
  • re-compiled
  • sort of success

The system still behaves mysterious! I can’t use Ableton Live as destination application anymore.
Error “Choose a destination with a supported architecture in order to run on this system”…
Then I switched to the oldest available Base SDK 10.7 w/o success. Don’t know what to do anymore.

This bloody Apple- “We have the most sophisticated operating system in the world”- OSX- shit drives me mad!

So if somebody knows what to change to use Ableton again as destination, please let me know.

Thanks in advance!
Joerg


#7

Might be 32/64 bit issues (ie you build for x64 only and Ableton runs on i386 or vice-versa)?
Are you building for all platforms?


#8

Thanks,

i’ll give it a try tonight.

Best,
Joerg


#9

this may also interisting 

 

http://teragonaudio.com/article/Building-AudioUnits-with-modern-Mac-OSX.html


#10

Instructions comment: http://www.juce.com/comment/291142#comment-291142

(Jeorg linked to it above but his url is from the old forum and currently sends to the thread instead of the relevant comment)

 


#11

-------

UPDATE: I was specifying Plugin AU Main Type as: aufx . Apparently it didn't like that very much. But by removing the specification, the Rez error disappeared and it started building again. Still strange that this didn't cause a problem before. I got the inspiration for the change from this link: http://sample-hold.com/2011/11/23/getting-started-with-audio-units-on-os-x-lion-and-xcode-4-2-1/

Moral of the story is, don't specify a AU Type unless you know its something super fancy. And if you're not a complete bafoon who can't read tool tips like yours truly, there's a suggestion in the introjucer to leave it blank unless you want to use a custom value. I hope that helps others.

-------

I have a phantom Rez error that is persistently creeping into my audio plugin Xcode project. I have had to rebuild my plugin from scratch several times, piece by piece to see when/where it suddenly breaks. Yesterday, I successfully built a working plugin with a few GUI elements and no meddling with the processBlock(). I added a few things piece by piece, building every now and again to see if something that I was doing was introducing the error. Things were looking good. It was building fine. My changes were refelcted in the built component. Life was good... I stopped working on it last night, I saved and closed the computer, wok up today, I went to work, came home and ate dinner, opened up the laptop, tried to build the project which was unaltered since it had built successfully the night before, and then....

/Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUResources.r:83: ### /Applications/Xcode.app/Contents/Developer/usr/bin/Rez - Badly formed expression./Users/jburns/JUCE-Projects/MultiCorrelator/Builds/MacOSX/../../JuceLibraryCode/modules/juce_audio_plugin_client/AU/juce_AU_Resources.r: ### /Applications/Xcode.app/Contents/Developer/usr/bin/Rez - Since errors occurred, /Users/jburns/Library/Developer/Xcode/DerivedData/MultiCorrelator-ghzjsikklsbnmlebqfensmtbxsqc/Build/Intermediates/MultiCorrelator.build/Debug/MultiCorrelator.build/ResourceManagerResources/Objects/juce_AU_Resources.rsrc's resource fork was not written.Command 
/Applications/Xcode.app/Contents/Developer/usr/bin/Rez failed with exit code 2

line 83 is in RES_ID and it just says COMP_TYPE. this issue keeps popping up every so often, for no apparent reason.

I have read the plethora of posts regarding this issued beginning around late 2012. The closest allusion to something similar to exit code 2 was someone saying that in "Build Carbon Resources" the project included one too many files. Since I created a fresh project yesterday, I only have VST and AU checked off in my .jucer file. Perhaps purposefully, the Introjucer insists on including 'juce_RTAS_MacResources.r' along with 'juce_AU_Resources.r'. I don't know if it necessary or not, but deleting the [RTAS.r] doesn't fix the error anyway. I am certain I have the CoreAudio files in the correct location. And I am certain that NOTHING could have changed about my project overnight with the computer sleeping and untouched.

Has anyone encountered recurring Rez errors such as this for no apparent reason. Maybe someone has successfully and permanently conquered this issue?

I'm using Xcode 4.6.3 and for external hardware reasons I am betrothed to OS 10.7.5 for the moment. I really hope someone's suggested fix for this issue isn't: get Maverics and Xc5 (which is certainly something I have considered.)

It built yesterday, then 24 hours later without being touched, its permanently tainted with the Rez error. Anyone got a hint?


#12

It might go beyond just this, but If line #83 is 'COMP_TYPE', then you are working off an older version of the utility classes (probably the 2007 version),  and/or the files got scrambled between a few versions/locations somewhere along the line (which can happen if the project is pointing to different versions and 'copy items into destination group's folder' is selected).  Some of the Apple downloads are scrambled as well for some reason too, so check each file manually: the newest versions reads "Version: 1.0.4" in the top comments of all the files, the version you are likely using reads "Copyright  2007 Apple Inc" in the top comments of some or all the files.  Also, the utility classes can live in several different places,  as the location has changed from Xcode 3/4/4.2/4.6 and 5, so make sure the version pointed to  by your project file is the newest version, and also that files are not pointing to different versions in different locations.  

 

Since I have old and new project that point to those files in the current and legacy locations, I went through and deleted all the locations and then replaced them all with the 1.0.4 versions in Xcode.app/Contents/Developer/Extras/,   /Developer (the old old location),   /Library/Developer/Extras/,    and /Library/Developer/.  I know that is messy, but it saves time re-assigning the file locations in the Xcode IDE, and ensures that they will be where expected if I have to open the project in an older version of XCode.  If you have no need to do that, you can delete them all except the default JUCE location in XCode.app and check each file to make sure it is the more recent version.

 

I was able to eventually reproduce your exact error and line # when building the demo plugin, buy mixing and matching files from the 6 different versions of the Core Audio Utility Classes that I have hanging around on my machine (2002,  2007,  1.0.1, 1.0.2, 1.0.3, 1.0.4) until I got the same error,  and then fixed the error by deleting them all and replacing with the 1.0.4 version, so hopefully that solves the issue for you. (I also eventually reproduced it by adding extra spaces and whitespace to the file:  I wanted to check that because I have had REZ errors when I copy/pasted certain things and ended up with an extra space at the end of the word or extra line between elements/at the end of the file).

Good luck!

 

(I know the question is a month old, but I put this up in case anyone else runs into it looking for help with the same problem).


#13

Ever since I updated the Core Audio Utility Classes to Version 1.1, 2014-07-08 I can't compile AU's without these four compiler errors in the juce_AU_Wrapper.mm document:

My juce modules and the Introjucer are up to date.  Should I roll back to the preview AU code from Apple?


#14

Nevermind I figured it out. For some reason, starting over from a blank introjucer template and regenerating the Xcode project fixed it.


#15

Hi guys, 

this is how I fixed it. 

  1. Download CoreAudio library from here https://developer.apple.com/library/ios/samplecode/CoreAudioUtilityClasses/Introduction/Intro.html
  2. Go to Xcode.app and see package contents.
  3. Go to Contents/Developer and create a folder named Extras
  4. Copy the CoreAudio folder downloaded in step 1 to Extras
  5. Move the folder CoreAudio one level up: the original path is Extras/Developer/CoreAudioUtilityClasses/CoreAudio but should be DExtras/Developer/CoreAudio.
  6. Now build the plugin in Xcode.

I really hope this helps. 

Cheers!

Manuel


#16

you don't have to patch XCode anymore, you can define the Plugin AU SDK path in Introjucer

 


#17

Hi. I'm getting the same problem, but only with release builds. Yosemite. xcode 6.1. Juce 3.20

/Volumes/Data/Development/SDKs/CoreAudio/AudioUnits/AUPublic/AUBase/AUResources.r:89: ### /Applications/Xcode.app/Contents/Developer/usr/bin/Rez - Badly formed expression.

/Volumes/Data/Development/Juce/Projects/Nebula2/JuceLibraryCode/modules/juce_audio_plugin_client/AU/juce_AU_Resources.r: ### /Applications/Xcode.app/Contents/Developer/usr/bin/Rez - Since errors occurred, /Users/Rob/Library/Developer/Xcode/DerivedData/Nebula-bhrbdrjszsuimcahnupfpluxgity/Build/Intermediates/Nebula.build/Release/Nebula.build/ResourceManagerResources/Objects/juce_AU_Resources.rsrc's resource fork was not written.

Command /Applications/Xcode.app/Contents/Developer/usr/bin/Rez failed with exit code 2

The CoreAudio files are the latest. I've deleted them from inside the xcode app. I'm using the latest Juce 3.20. The demo plugin builds fine, both debug and release. 

It's a huge project, and I've already setup a whole new plugin project via the introjucer and copied everything across...to the same result. Before I try again using the demo plugin instead...can anyone offer any advice?

Thanks,

 

Rob


#18

Didnt' work copying everything across to the demo plugin project. Been stuck on this for 2 days! Now debug builds don't work either. I've tried everything everyone has suggested above....


#19

Fixed! I was using a different version of the juce_AU_resources.r file...oops. 


#20

Where?  Mine has suddenly stopped working with the latest Introjucer, it can't find AUMIDIEffectBase.h any more even though it's not moved :)