C- Code compilation on Ipod Touch

Discussion in 'iOS Development' started by harish87, Dec 26, 2009.

  1. harish87

    harish87 New Member

    Joined:
    Dec 4, 2009
    Messages:
    8
    Likes Received:
    0
    Device:
    3G iPod touch
    Hi,

    I am working to create an HRM for the IPod and as part of that I need to use the c-code that came with the manual. Also, I need to access the serial interface the Tx and Rx pins.

    Having said that, I have the code ready to be compiled. But here is where I am getting confused. Can i just do the following line on the IPod:

    gcc -Wall -c Myapp.c
    gcc Myapp.o -o Myapp

    or do i have to inlcude the UI libraries as well?
  2. hyernado

    hyernado New Member

    Joined:
    Apr 13, 2009
    Messages:
    127
    Likes Received:
    0
    Device:
    2G iPod touch
    To compile on an actual device, you must be on a 2.x firmware, as libgcc has not been ported to 3.x yet (and by the time it is, 4.0 will probably be old), so downgrade to 2.2.1 or something, then try compiling, and just hope the app works on 3.x.
  3. powerpup118

    powerpup118 New Member

    Joined:
    Jan 2, 2009
    Messages:
    69
    Likes Received:
    0
    Device:
    2G iPod touch
    gcc -Wall -c Myapp.c
    gcc Myapp.o -o Myapp

    will work fine.

    just as any other unix environment.. you only need to include what your program uses.

    if your program uses the ipod UI then you must include those libs..
  4. harish87

    harish87 New Member

    Joined:
    Dec 4, 2009
    Messages:
    8
    Likes Received:
    0
    Device:
    3G iPod touch

    actually.....i have the 3.1.1 jailbroken and i have the libgcc installed in it
    ------------------double post merged------------------
    iite i will give it a try
    ------------------double post merged------------------
    ok...i tried to run those files directly on the Iphone and I got the:

    gcc -Wall -c Myapp.c

    command working. But when i try "gcc Myapp.o -o Myapp" it throws an error at me saying that:

    "ld: Library not foun for -lSystem"
    "collect2: ld returned 1 exit status"

    wut does this mean?
  5. qiuqiyuan

    qiuqiyuan New Member

    Joined:
    Jan 21, 2010
    Messages:
    1
    Likes Received:
    0
    same problem

Share This Page