Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2016 16:56:29 +0000
From:      John Howie <john@thehowies.com>
To:        Arnab Bhowmick <arnabbhowmick08@gmail.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: c compiling using clang
Message-ID:  <822D1209-D65C-4F45-A287-A81A7E31EBE1@thehowies.com>
In-Reply-To: <CADNZooNCtC5D4KfoL0S94vj=v%2BgqzLXsh_Ruj%2B-h0ZvpyboW%2BQ@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

Hi Arnab,

The ‘%’ is the UNIX (FreeBSD) prompt, shown in examples in text books. Do not type it in. Depending on your shell, and whether or not you are running as root, you might have $ or # as your prompt instead, or even something fancier depending on how your profile is setup.

Just type “cc filename.c” (not the quotes, they are there to highlight what to type). This will produce a file called a.out. You run that by typing “a.out” (again, do not type the quotes). If you want to compile your program to a named file you would type “cc -o myfile filename.c”, and to run the program just type “myfile”.

Regards,

John





On 4/27/16, 12:49 AM, "owner-freebsd-questions@freebsd.org on behalf of Arnab Bhowmick" <owner-freebsd-questions@freebsd.org on behalf of arnabbhowmick08@gmail.com> wrote:

>I am new to Freebsd. I want to practice c programming for my college
>projects. I have wrote some program but when i am trying to compile the
>program by using
>% cc filename.c its showing % not found. I went through the handbook but
>did not understand the process. Previously i have used clang compiler on
>Ununtu but i think that it is a little bit tricky to compile c under
>freebsd. Can anyone say how to resolve this?
>_______________________________________________
>freebsd-questions@freebsd.org mailing list
>https://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?822D1209-D65C-4F45-A287-A81A7E31EBE1>