On Wed, 29 Oct 2008 18:57:25 -0700, Linh Duong wrote:

> Hello There,

> I am new to C. I had look at the manual, configuration, and etc.

> Try to run the file on MAC OS.

> Downloaded gcc-testsuite-4.3.2

> gcc -o hello.c
> gcc -v hello.c

> It returns command not found. Can you please tell me what's wrong?

> #include <stdio.h>
> main ()
> {
> printf("Hello World\n");
> }


> Thanks,
> Linh

Your first step is to install Xcode.  This will be on the system discs
that came with your Mac.  Xcode includes gcc, but is not installed by
default.  Once you run the installer, you should find gcc in
/usr/bin/gcc, which is automatically in your PATH.

You can then run your program by using the commands

        gcc -o hello hello.c
        ./hello

Alternatively, you can launch Xcode and select "New Project" from the
File menu.  Then click on "Command Line Utility" in the sidebar of the
window that comes up, and select "Standard Tool" from the available
templates in the window.

Dave Seaman
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to