SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder...
Transcript of SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder...
SDL-Setup-TutorialforMacOSwithXcodeBasedonthepreviousSDL-Setup-tutorialbyAndreasKramer,ImanagedtobuildtheprojectfilesonthelatestMacOSX(Version10.11.1)withXcode7.0.1.Iwouldliketoshare my experience, update the changes and explain some confusing settings indetailsfortheotherMacusersinDH2323.
Step1:DownloadSDL1.2(http://www.libsdl.org/download-1.2.php).
I choose thisversion justbecause its installationpackagehas the“SDLMain.m” fileinsideofthe“devel-lite”folderwhileSDL2.0havenosuchone.
Step2:Install“SDL.framework”
Copyittothepath“/Library/Frameworks”. Indetails:open”Finder”,press”command+shift+g”andinputthepath.
Thenyoucometothefolderandcaneasilycopythe“SDL.framework”toit.
Step3:OpenXcodeandcreateaCocoaApplication.
Step4:Selecttheblue iconofyourprojectandgotothe“BuildingSettings”.Then
switchthe“Objective-CAutomaticReferenceCounting”itemto“No”.
Step5:DeleteAppDelegateandMainMenu,andmovethemtotrash.
Step6:Delete“main.m”,andmoveittotrash.
Step7:Open the “/Library/Frameworks” folder anddrag the file ”SDL.framework”
underyourproject“SDLwithGLM”.AndimportWITHOUTcopyingandaddtotarget.
Step8:Select theblue iconof yourprojectandgo to the “BuildingSettings”.And
Searchforheader.
Step9: Add “/Library/Frameworks” to Framework Search Paths and Add
“/Library/Frameworks/SDL.framework/Headers”toHeaderSearchPaths.
Step10:Findthe“devel-lite”folderintheinstallationpackageofSDL1.2
Step11:Dragittoyourprojectunderthefolder”SupportingFiles”,copyitandadd
totarget.Ifyoudoneitcorrectly,theiconofitshouldbeyellow.
Step12: Find “SDLauxiliary.h” in “CgLab1”, drag it to your project under the
folder”SupportingFiles”,copyitandaddtotarget.
Step13:Similarlyfind“skeleton.cpp”in“CgLab1”,dragittoyourprojectunderthe
folder”SupportingFiles”,copyitandaddtotarget.
Step14:TimetoimportGLM-youwantthefolderwithintheGLMfolderwiththe
same name. When you found that folder - drag it into Xcode under thefolder”SupportingFiles”.MakeXcodetocopyitintoitsownprojectfolder.
Step15:Deletethe“Dummy.cpp”filewithinthe“core”folderinsideGLM-thisfile
contains a main function which will make Xcode execute that file instead of“skeleton.cpp”.Move“Dummy.cpp”totrash.
Step16:Asfor“skeleton.cpp”,afterimportingandsettingupbuildsettings-Xcode
shouldrecognizeGLMandsuggesttoincludeitwithquotesinsteadofangelbrackets.
Itshouldlooklikethisafter:
Step17:Dothesameproceduresto“SDLauxiliary.h”:
after:
Step18:Buildandrun.