gcc problem?

Discussion in 'iOS Development' started by Your Everyday Hacker, Oct 2, 2008.

  1. Your Everyday Hacker

    Your Everyday Hacker Banned

    Joined:
    Aug 12, 2008
    Messages:
    645
    Likes Received:
    0
    I'm currently messing around with Obj-C and some tutorials.
    Anyways, I have gcc installed. I [believe] I'm supposed to go into terminal and type in what I'd want to do, for example:

    [quick hello world example]


    Anyways, I'm getting this error:
    hello.m is made and is currently on my desktop.
    What am I doing wrong? ;-;
  2. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    this wont fix your problem but you need to put
    Code:
    gcc -lobjc hello.m -o hello.o
    or

    Code:
    gcc -c hello.m -o hello.o
    this might fix it before you type that type
    Code:
    cd /location of file
    replacing location of file with the location of the file


    this is of the top of my head so not promising anything

    I might be completely wrong post back and tell me if it worked
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    it looks to me as if you're using the xcode gcc, in which case you need to specify both the sysroot directory and the mach-o architecture


    Code:
    gcc -arch armv6 -isysroot "DIRECTORY" myfile.c -o myfile
  4. Your Everyday Hacker

    Your Everyday Hacker Banned

    Joined:
    Aug 12, 2008
    Messages:
    645
    Likes Received:
    0

    Thank you.

    Please Register or Log in to view images

  5. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    see I was totally wrong probably cus I''m on Windows and I'm a n00b at coding

Share This Page