Changes between Version 3 and Version 4 of Building/CrossCompiling/iOS


Ignore:
Timestamp:
Feb 27, 2013 11:30:30 PM (2 years ago)
Author:
StephenBlackheath
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/CrossCompiling/iOS

    v3 v4  
    9595}}} 
    9696 
    97 === 6. Compile your Haskell code === 
     97=== 6. Create an Xcode project === 
     98 
     99Create a new skeleton Xcode project using the wizard, and make sure it runs on your device. 
     100 
     101=== 7. Compile your Haskell code === 
    98102 
    99103Open a terminal and add {{{/usr/local/ghc-ios/bin}}} to your {{{PATH}}} environment variable. 
     
    140144This will create (in this example) '''haskell.a'''. 
    141145 
    142 === 7. Set up Xcode === 
     146=== 8. Set up your Xcode project for Haskell === 
    143147 
    144 Create a new skeleton Xcode project using the wizard, and make sure it runs on your device. Now configure it as follows: 
     148Now configure it as follows: 
    145149 
    146150 * Click on the top node in the project tree, then go to the '''Build Settings''' tab. Set '''Dead Code Stripping''' to '''No'''. This is needed because GHC generates "tables next to code", and without this setting, Xcode thinks the tables are dead code and strips them, causing a crash. 
     
    150154 * When you've compiled your Haskell code to a .a (e.g. '''haskell.a''') file, add it to the project anywhere in the hierarchy with '''Add files to (project)''' in the right-mouse button menu. 
    151155 
    152 === 8. Build and run === 
     156=== 9. Build and run === 
    153157 
    154158Run the project again as usual, and Xcode will pick up the haskell.a file and your Haskell code should now run on your iOS device. Anything printed with putStrLn will appear in the Xcode runtime console.