View Full Version : OS X compiling
Astralp
01-20-2010, 07:09 AM
Hi all
I've just started to mess around with OSX, I have xcode installed, (although I'm hoping to use codeblocks which I know well). I've been trying to compile lice but to no avail, does anyone have an xcode(or codeblocks) project for this? I tried in codeblocks, it wants to link in windows.h even though I've set a global def __MAC__ any help would be appreciated. I'll continue to messaround...
Oh, where in xcode do you add/remove linked libraries, I can't seem to find it?
Andy
RRokkenAudio
01-20-2010, 08:44 AM
Just out of curiosity, Can plugs be compiled on Hackintosh?
Astralp
01-20-2010, 09:41 AM
Yes, if you have compatible hardware and you can get OSX working with everything, there is no difference to a real Mac.
Astralp
01-20-2010, 08:38 PM
Worked it out, I'll post the solution to help other OSX arrivals. This post was helpful:
http://forum.cockos.com/showthread.php?t=46498
The things I didn't get was that in the example xcode project you have to find Frameworks and libraries/Linked Frameworks/IPlug.xcodeproj double click it which will open it in a new window, and then build. But that creates errors, so you have to go to the VST SDK and open aeffect.h, scroll down to line 82 and change the #if to #ifdef. IPlug should then compile.
You can then go back to the example project and it should compile correctly.
Xenakios
01-21-2010, 06:57 AM
Just out of curiosity, Can plugs be compiled on Hackintosh?
They can be, but if you are serious about Mac development, you need the Apple hardware used by legit Mac users to be sure everything really works in a production environment.
metalhobo
04-01-2010, 08:14 PM
Hello, first post here :)
I'm trying to compile the IPlug project and I'm running into some problems. For the record, I'm running 10.4.11, SDK 10.4u, Xcode 2.5. I'm running into some problems with Swell. When Xcode tries to compile the swell-gdi.mm file, I get these errors:
error: 'CGFloat' was not declared in this scope
error: expected `;' before 'cols'
error: 'cols' was not declared in this scope
error: 'CGFloat' was not declared in this scope
error: expected `;' before 'comp'
error: 'comp' was not declared in this scope
I noticed in the swell-internal file 'CGFloat' was defined just as 'float' for OSX under 10.5. (I'm on 10.4).
Anybody got any ideas?
Astralp
04-01-2010, 08:28 PM
welcome!
I can't be of much use really, my mac experience is small and started with 10.5, but I would first try changing it to float and see what happens :)
Looks like CGFloat is part of cocoa so you maybe need to look at whether the cocoa core libraries are included in the project, probably something like core.cocoa? A total guess and maybe not much use, hopefully someone will know more.
metalhobo
04-01-2010, 10:39 PM
If I replace all instances of 'CGFloat' with 'float' in the swell-gdi.mm file and build I get
error: a function-definition is not allowed here before '{' token
error: 'cols' was not declared in this scope
metalhobo
04-02-2010, 03:56 PM
Well, looks like I just needed to put an equals sign in there
CGFloat cols[4]={GetRValue(col)/255.0,GetGValue(col)/255.0,GetBValue(col)/255.0,alpha};
CGColorRef color=CGColorCreate(cspace,cols);
Built up good after I added the equals. I'm not sure if what I did is right, and if it is, I'm not sure why 'float' requires the equals but 'CGFloat' doesn't. As you can tell, I'm not too great with this computer stuff.
EDIT: Damn I feel dumb :facepalm:
Looking at a fresh swell-gdi.h that I unzipped, looks like I had accidentally deleted that equals sign sometime. God I'm an idiot. No idea how I did that. Oh well, works now :)
Example plug builds up fine and loads into Reaper. Disaster thwarted . . . for now.
Astralp
04-02-2010, 03:59 PM
Great, glad you got it sorted :)
pixeltarian
04-02-2010, 10:31 PM
I like you. feel free to compile that MCU extension for the mac. I will love you forever. no homo.
cerberus
07-19-2010, 11:45 AM
i'm not able to compile iplug... i'm getting errors compiling iPlugExample..
http://gyazo.com/6b5bbfe598361d0287648ecef09f5c75.png
and iPlug.xcodeproj (which is contained in iPlugExample)
http://gyazo.com/28501d701dd3b52345a8bc1f613a1ba3.png
---
i was able to build the swell example thanks to soundbytes' post here : http://forum.cockos.com/showthread.php?t=52609
but i don't find my latest errors mentioned on the forums. (10.6, i386)
tia for some help here.
i'm not able to compile iplug... i'm getting errors compiling iPlugExample..
http://gyazo.com/6b5bbfe598361d0287648ecef09f5c75.png
I think Xcode is trying to tell you that the linker can't find libIPlug.a. This is becaue you need to build iPlug.xcodeproj before you can build the example.
and iPlug.xcodeproj (which is contained in iPlugExample)
http://gyazo.com/28501d701dd3b52345a8bc1f613a1ba3.png
This is because of a known issue in line 82 of aeffect.h, see:
http://forum.cockos.com/showpost.php?p=545661&postcount=2
cerberus
07-19-2010, 12:39 PM
thanks tale... i changed line 82 of aeffect.h, as you directed. now i get fewer errors,
but the build still fails: http://gyazo.com/13b75942430685130adeda6cccfb13e5.png
btw, i am only interested in compiling for vst, not au. but since i changed the code line i notice
that it wants to build "iPlugAU.cpp" wheras before it was building "iPlugVST.cpp"... that's odd!
thanks again.
IPlug always builds for both VST and AU, so you can choose between VST or AU later on, in this case in the example project.
I think the error is because you are building for OS X 10.6. There is some extra code for OS X >10.4, which apparently isn't working. Target OS X 10.4, and you the extra code will be ignored. Alternatively you could probably comment out the following blocks in IPlugAU.cpp:
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
NO_OP(kAudioUnitProperty_AUHostIdentifier); // 46,
NO_OP(kAudioUnitProperty_MIDIOutputCallbackInfo); // 47,
NO_OP(kAudioUnitProperty_MIDIOutputCallback); // 48,
NO_OP(kAudioUnitProperty_InputSamplesInOutput); // 49,
NO_OP(kAudioUnitProperty_ClassInfoFromDocument); // 50
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
case kAudioUnitProperty_AUHostIdentifier: { // 46,
AUHostIdentifier* pHostID = (AUHostIdentifier*) pData;
CStrLocal hostStr(pHostID->hostName);
int hostVer = (pHostID->hostVersion.majorRev << 16) + (pHostID->hostVersion.minorAndBugRev << 8);
SetHost("", hostStr.mCStr, hostVer);
return noErr;
}
NO_OP(kAudioUnitProperty_MIDIOutputCallbackInfo); // 47,
NO_OP(kAudioUnitProperty_MIDIOutputCallback); // 48,
NO_OP(kAudioUnitProperty_InputSamplesInOutput); // 49,
NO_OP(kAudioUnitProperty_ClassInfoFromDocument) // 50
#endif
On second thought, simply changing this line
SetHost("", hostStr.mCStr, hostVer);
in IPlugAU.cpp into
SetHost(hostStr.mCStr, hostVer);
might also do the trick. If so, then we should Schwa know there's a small typo in IPlugAU.cpp.
junioreq
07-19-2010, 01:15 PM
Tale, how are the directories working on this for xcode? He may be confused as to the directory structure as well... btw heres another screenie of his from the example build:
http://gyazo.com/6b5bbfe598361d0287648ecef09f5c75.png
Man if only there were instructions lol..
~Rob.
Tale, how are the directories working on this for xcode?
Well, I just extracted WDL in my Documents folder, and it worked. As long as you leave the directory structure of WDL as it is, I think you should be fine.
btw heres another screenie of his from the example build:
http://gyazo.com/6b5bbfe598361d0287648ecef09f5c75.png
Hmmm... I wonder why it says "Base SDK | Debug | IPlugExample" in your screenshot, while on my MacBook it simply says "Debug | IPlugExample". Have you installed Xcode with the optional 10.4 SDK?
Man if only there were instructions lol..
If there were instructions, then it would be no fun anymore. :p
junioreq
07-19-2010, 01:31 PM
heh, you know, it would not be fun your right lol, well I dev on windows, poor cerberus here is having problems :(
Yeah, i was wondering too wtf is up with that "base sdk" some kind of dev tools or something cerb?
What exactly did you do to get all this up and running cerberus?
cerberus
07-19-2010, 01:33 PM
hi tale; your "commenting out" fix worked for iPlug.xcodeproj
now "libIPlug.a" is not missing... :)
however, i am still getting the same error for the example project
http://gyazo.com/6b5bbfe598361d0287648ecef09f5c75.png
Have you installed Xcode with the optional 10.4 SDK?
yes. now that i changed to "10.6" it says "succeeded" !!!!! yay! now i'll see if the plug-in works...
cerberus
07-19-2010, 01:41 PM
http://gyazo.com/28cc2369705be8b17aba9da0fd0c72ef.png
yay success! thanks tale and junioreq
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.