Results 1 to 12 of 12
  1. #1
    Developing on a macbook

    Member Since
    Jul 14, 2006
    Posts
    29
    Developing on a macbook
    Decided to continue what i began learning about 2 months ago, and that is the C language. So i hear that i need something called Apple Developer Tools.

    After searching their site on the developer tools, i came across something called xcode 2.0 (approx. 960Mb). Is this what i need so that i can begin develpment programs on my macbook?

  2. #2
    Developing on a macbook

    Member Since
    May 27, 2006
    Location
    Concord, NC
    Posts
    445
    Specs:
    Macbook Pro 17" 2.6GHz 4GB RAM
    Yes- it works great.

  3. #3
    Developing on a macbook
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Xcode comes on your install disks, so you don't have to download the very latest from Apple. The downlaod requires an ADC membership of which they have a free version.

  4. #4
    Developing on a macbook

    Member Since
    Jul 14, 2006
    Posts
    29
    coding on mac
    so i downloaded apple developer tools (Xcode 2) and installed it. I made doubly sure i had GCC 3.3 and 4.0 installed aswell as X11 but, i assume the main installer installs these rather then me having to go through every package manually.

    I wrote a simple "Hello" program using the text editor "VI" in terminal. But..im a little unsure how to execute. normlly i did "a.out test" and it would compile and run..but it appears differently in OS X.

    Anything im doing wrong? my code is below..but i know its rght lol..

    #include stdio.h

    main()
    {
    printf("Hello worl/n");
    }

  5. #5
    Developing on a macbook
    D3v1L80Y's Avatar
    Member Since
    Feb 02, 2004
    Location
    PA
    Posts
    12,456
    Specs:
    MacBook
    NOTE: Continuation of previous post. Merged threads
    __________________________________________________
    Posting and YOU|Forum Community Guidelines|The Apple Product Cycle|Forum Courtesy

    mac: a waterproof raincoat made of rubberized fabric
    MAC: a data communication protocol sub-layer, also known as the Media Access Control
    Mac: a brand name which covers several lines of personal computers designed, developed, and marketed by Apple Inc.


  6. #6
    Developing on a macbook

    Member Since
    Apr 25, 2003
    Location
    The home of the free and the land that did for Braveheart.
    Posts
    1,301
    Specs:
    24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
    Quote Originally Posted by boletje View Post
    so i downloaded apple developer tools (Xcode 2) and installed it. I made doubly sure i had GCC 3.3 and 4.0 installed aswell as X11 but, i assume the main installer installs these rather then me having to go through every package manually.

    I wrote a simple "Hello" program using the text editor "VI" in terminal. But..im a little unsure how to execute. normlly i did "a.out test" and it would compile and run..but it appears differently in OS X.

    Anything im doing wrong? my code is below..but i know its rght lol..

    #include stdio.h

    main()
    {
    printf("Hello worl/n");
    }

    a.out is the default name for the executable created by cc after it is compiled and linked.

    If your source file is called test.c then try cc test.c

    And it probably should be #include "stdio.h"

    Oh and you left the d off of "world".

    Amen-Moses

    (edited to add: Mind you, you really want to use XCode, if you have fully installed it the main XCode executable is in /Developer/Applications.

    Google for XCode tutorials as well.)

  7. #7
    Developing on a macbook

    Member Since
    Jul 14, 2006
    Posts
    29
    ok thanks for the quick reply! I just tried what you suggested and its given me two error msgs...

    i686-apple-darwin8-gcc-4.0.1: test: no such file or directory
    i686-apple-darwin8-gcc-4.0.1: no input files

    Opened the file using Xcode...cant build or do anything else other then edit with it. The file is saved in the same location as where ive pointed all the project files to go ... simon/Documents/C_Proj_Files

  8. #8
    Developing on a macbook

    Member Since
    Apr 25, 2003
    Location
    The home of the free and the land that did for Braveheart.
    Posts
    1,301
    Specs:
    24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
    Quote Originally Posted by boletje View Post
    ok thanks for the quick reply! I just tried what you suggested and its given me two error msgs...

    i686-apple-darwin8-gcc-4.0.1: test: no such file or directory
    i686-apple-darwin8-gcc-4.0.1: no input files

    Opened the file using Xcode...cant build or do anything else other then edit with it. The file is saved in the same location as where ive pointed all the project files to go ... simon/Documents/C_Proj_Files

    Have you got the .c on the end?

    btw XCode is a full GUI development tool, you really need to read a tutorial on it.

    Amen-Moses

  9. #9
    Developing on a macbook

    Member Since
    Jul 14, 2006
    Posts
    29
    yes, the file is called.. "test.c"

  10. #10
    Developing on a macbook

    Member Since
    Apr 25, 2003
    Location
    The home of the free and the land that did for Braveheart.
    Posts
    1,301
    Specs:
    24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
    Quote Originally Posted by boletje View Post
    yes, the file is called.. "test.c"
    Well in that case ...

    cc test.c

    followed by (assuming no errors) ...

    ./a.out

    Should do the trick if everything is installed correctly.

    (Oh and you have to be in the same directory as the test.c file but I assumed that was obvious.)

    Amen-Moses

  11. #11
    Developing on a macbook
    novicew's Avatar
    Member Since
    Jan 04, 2006
    Location
    Hamburg, Germany
    Posts
    1,385
    Specs:
    MacBook Pro | iMac(2.1 G5) | MacBook(2.16 C2D) | MacMini (1.67 CD) | iPhone 4 | iPad (3rd Gen)
    In Terminal
    test.c
    #include <stdio.h>

    int main()
    {
    printf ("Hello World\n");

    }
    $gcc -o test test.c ---> to create an execution file.

    $./test --->to execute

  12. #12
    Developing on a macbook

    Member Since
    Jul 14, 2006
    Posts
    29
    i just get the message from bash that "-o command not found"

    UPDATE: seemed to work eventually. i just moved the file from location..replaced it and it seemed to work. TY for help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Eclipse Developing program
    By Yodda_Hunter in forum OS X - Apps and Games
    Replies: 7
    Last Post: 06-14-2013, 01:46 PM
  2. developing programes for OS X
    By Yodda_Hunter in forum OS X - Apps and Games
    Replies: 7
    Last Post: 06-09-2013, 08:44 PM
  3. regarding developing an app
    By abhicse079 in forum iOS and Apps
    Replies: 1
    Last Post: 02-16-2012, 08:57 PM
  4. Developing Applications
    By GoC_Derek in forum iOS and Apps
    Replies: 3
    Last Post: 11-21-2008, 02:43 PM
  5. web developing
    By aarnclayt in forum Switcher Hangout
    Replies: 2
    Last Post: 12-16-2007, 07:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •