SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder...

8
SDL-Setup-Tutorial for Mac OS with Xcode Based on the previous SDL-Setup-tutorial by Andreas Kramer, I managed to build the project files on the latest Mac OSX (Version 10.11.1) with Xcode 7.0.1. I would like to share my experience, update the changes and explain some confusing settings in details for the other Mac users in DH2323. Step1: Download SDL 1.2 (http://www.libsdl.org/download-1.2.php). I choose this version just because its installation package has the “SDLMain.m” file inside of the “devel-lite” folder while SDL 2.0 have no such one. Step2: Install “SDL.framework” Copy it to the path “/Library/Frameworks”. In details: open ”Finder”, press ”command+shift+g” and input the path. Then you come to the folder and can easily copy the “SDL.framework” to it.

Transcript of SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder...

Page 1: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

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.

Page 2: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

Step3:OpenXcodeandcreateaCocoaApplication.

Step4:Selecttheblue iconofyourprojectandgotothe“BuildingSettings”.Then

switchthe“Objective-CAutomaticReferenceCounting”itemto“No”.

Page 3: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

Step5:DeleteAppDelegateandMainMenu,andmovethemtotrash.

Step6:Delete“main.m”,andmoveittotrash.

Step7:Open the “/Library/Frameworks” folder anddrag the file ”SDL.framework”

underyourproject“SDLwithGLM”.AndimportWITHOUTcopyingandaddtotarget.

Page 4: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

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

Page 5: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

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.

Page 6: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

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.

Page 7: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

Step16:Asfor“skeleton.cpp”,afterimportingandsettingupbuildsettings-Xcode

shouldrecognizeGLMandsuggesttoincludeitwithquotesinsteadofangelbrackets.

Itshouldlooklikethisafter:

Step17:Dothesameproceduresto“SDLauxiliary.h”:

after:

Step18:Buildandrun.

Page 8: SDL-Setup-Tutorial for Mac OS with Xcode€¦ · Step11: Drag it to your project under the folder ”Supporting Files”, copy it and add to target. If you done it correctly, the

Step19:Success.

Happycoding:)

Original:AndreasKramer

Updated:ShiQiu([email protected])