Building AU with delay object fails

jvkr's icon
Max Patch
Copy patch and select New From Clipboard in Max.

A simple delay creates the following error when building:
Must use 'struct' tag to refer to type 'Delay' in this scope

error.png
png
g2312's icon

Try to rename "param Delay" to "param Delaytime". "Delay" conflicts with the internal object name in the .cpp code.

jvkr's icon

Thanks for the suggestion. But after renaming the issue persists. Actually, I came across this error using another gen patch where the parameter Delay doesn't exist. It seems inherent in the Delay method. And sure, using the parameter Dalay isn't really a good idea.

g2312's icon

Found it. My suspicion that there is a naming conflict was right. "Delay" is used by Apple in CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h. Found this after performing "Product->Perform Action->Preprocess "gen_exported.cpp"". After renaming "Delay" to e.g. "GENDelay" at all locatons the project builds, but: the product shows only up as a folder and auval and any audio app I tried don't see it as plugin. Hm.

jvkr's icon

Thanks for getting to the bottom of this. Is my understanding correct that this must be addressed by Cycling?

g2312's icon

Yes, I think so. Or maybe Cycling is ahead of our time since "Delay" is in the framework marked as "__OSX_AVAILABLE_BUT_DEPRECATED". This means in a future release of OSX it will be gone.

Wesley Smith's icon

I was able to fix compilation by changing:Delay m_delay_1;
tostruct Delay m_delay_1;

For some reason, only the AU project exhibits this error.

jvkr's icon

That did the trick, thanks Wesley.