Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24
Discuss [How-To] Install gcc compile at the iPhone Developer Exchange - Hackint0sh.org; How can I compile a simple .c file (a command line application) for the iPhone?...
  1. #11
    Rookie Array

    Join Date
    Dec 2007
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    How can I compile a simple .c file (a command line application) for the iPhone?


  2. #12
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    Quote Originally Posted by Korb View Post
    How can I compile a simple .c file (a command line application) for the iPhone?
    here it is

    Code:
    echo 'main() { printf("Hello, world!\n"); }' >main.c 
    gcc -o main main.c 
    ldid -S main
    ./main
    Last edited by javacom; 09-02-2008 at 05:32 AM.
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  3. #13
    Rookie Array

    Join Date
    Dec 2007
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Thanks!
    So I have to input the entire code into the terminal on the iPhone?

  4. #14
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Thumbs up

    Just want to update the shell script to copy the SDK headers of 2.1 firmware from Mac to iPhone, if you have installed the iPhone SDK (build 9M2517) for (2.0 & 2.1 development)

    You have to change the IP address for your iPhone
    Code:
    #!/bin/sh
    IPHONEIP=10.0.2.2
    SDKVER=2.1
    sdkroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/System/Library/Frameworks
    sdkframeworks[1]=$sdkroot/AddressBook.framework/Headers/*
    sdkframeworks[2]=$sdkroot/AddressBookUI.framework/Headers/*
    sdkframeworks[3]=$sdkroot/AudioToolbox.framework/Headers/*
    sdkframeworks[4]=$sdkroot/AudioUnit.framework/Headers/*
    sdkframeworks[5]=$sdkroot/CFNetwork.framework/Headers/*
    sdkframeworks[6]=$sdkroot/CoreAudio.framework/Headers/*
    sdkframeworks[7]=$sdkroot/CoreFoundation.framework/Headers/*
    sdkframeworks[8]=$sdkroot/CoreGraphics.framework/Headers/*
    sdkframeworks[9]=$sdkroot/CoreLocation.framework/Headers/*
    sdkframeworks[10]=$sdkroot/Foundation.framework/Headers/*
    sdkframeworks[11]=$sdkroot/MediaPlayer.framework/Headers/*
    sdkframeworks[12]=$sdkroot/OpenAL.framework/Headers/*
    sdkframeworks[13]=$sdkroot/OpenGLES.framework/Headers/*
    sdkframeworks[14]=$sdkroot/QuartzCore.framework/Headers/*
    sdkframeworks[15]=$sdkroot/Security.framework/Headers/*
    sdkframeworks[16]=$sdkroot/SystemConfiguration.framework/Headers/*
    sdkframeworks[17]=$sdkroot/UIKit.framework/Headers/*
    sdkframeworks[18]=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDKVER}.sdk/System/Library/Frameworks/IOKit.framework/Headers/*
    iphonesdkroot=/var/sdk
    iphoneframeworksroot=$iphonesdkroot/include
    iphoneframeworks[1]=$iphoneframeworksroot/AddressBook/
    iphoneframeworks[2]=$iphoneframeworksroot/AddressBookUI/
    iphoneframeworks[3]=$iphoneframeworksroot/AudioToolbox/
    iphoneframeworks[4]=$iphoneframeworksroot/AudioUnit/
    iphoneframeworks[5]=$iphoneframeworksroot/CFNetwork/
    iphoneframeworks[6]=$iphoneframeworksroot/CoreAudio/
    iphoneframeworks[7]=$iphoneframeworksroot/CoreFoundation/
    iphoneframeworks[8]=$iphoneframeworksroot/CoreGraphics/
    iphoneframeworks[9]=$iphoneframeworksroot/CoreLocation/
    iphoneframeworks[10]=$iphoneframeworksroot/Foundation/
    iphoneframeworks[11]=$iphoneframeworksroot/MediaPlayer/
    iphoneframeworks[12]=$iphoneframeworksroot/OpenAL/
    iphoneframeworks[13]=$iphoneframeworksroot/OpenGLES/
    iphoneframeworks[14]=$iphoneframeworksroot/QuartzCore/
    iphoneframeworks[15]=$iphoneframeworksroot/Security/
    iphoneframeworks[16]=$iphoneframeworksroot/SystemConfiguration/
    iphoneframeworks[17]=$iphoneframeworksroot/UIKit/
    iphoneframeworks[18]=$iphoneframeworksroot/IOKit/
    
    ssh root@$IPHONEIP "mkdir -p $iphoneframeworksroot"
    scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/usr/include root@$IPHONEIP:$iphonesdkroot
    scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk/usr/lib root@$IPHONEIP:$iphonesdkroot
    
    for index in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
    do
      echo "copying ${sdkframeworks[index]} to ${iphoneframeworks[index]}"
      ssh root@$IPHONEIP "mkdir -p ${iphoneframeworks[index]}"
      scp -r ${sdkframeworks[index]} root@$IPHONEIP:${iphoneframeworks[index]}
    done
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  5. #15
    Advanced Array

    Join Date
    Aug 2008
    Posts
    37
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I set up my headers and was able to compile an app based off of this code: http://www.theiphonewiki.com/wiki/in...mework_Headers

    but for some reason the app doesnt show up in my springboard, is there something I need to in addition ?

    My app was sitting in the /var/root directory, but I also tried putting it into the /Applications directory


  6. #16
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    search "respring" in hackint0sh forum
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  7. #17
    Advanced Array

    Join Date
    Aug 2008
    Posts
    37
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    i actually did a killall SpringBoard and that didnt do it either...

    i'm actually running on 2.0.1 but the headers i dl'ed are from 2.1 -- should that matter ?

  8. #18
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    killall springboard cannot refresh the cache. This behaviour is changed in firmware 2.1, You need to have an updated respring to refresh the cache and then restart springboard in firmware 2.1

    see this post
    http://www.hackint0sh.org/forum/showthread.php?t=52037
    Last edited by javacom; 09-18-2008 at 01:54 AM.
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  9. #19
    Advanced Array

    Join Date
    Aug 2008
    Posts
    37
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    thanks, but i'm actually on 2.0.1, just my headers are on 2.1 -- does that make a difference ?

    I tried the respring app from big boss too, no dice

  10. #20
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    The header files do not matter, but the iphone wiki method does include usr/lib files and firmware 2.1 may not be compatible to your version (I did not try though)

    But what I guess is that your app in /Applications folder did not have the file Info.plist and that's why it did not show up.
    Last edited by javacom; 09-18-2008 at 03:50 AM.
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.



 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. compile webcore on mac
    By mhu in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 08-23-2012, 12:19 AM
  2. Compile iRecovery
    By sailor0703 in forum Tools
    Replies: 1
    Last Post: 09-27-2010, 10:57 PM
  3. UIWebView? Does it compile for you?
    By wififun in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 08-27-2007, 04:07 AM
  4. compile?
    By kdbdallas in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 08-09-2007, 04:02 AM
  5. Compile iphoneinterface on a Mac
    By amb1s1 in forum General
    Replies: 0
    Last Post: 07-10-2007, 02:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 03:49 PM.
twitter, follow us!