c compiling using clang

John Howie john at thehowies.com
Tue Apr 26 16:57:43 UTC 2016


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 at freebsd.org on behalf of Arnab Bhowmick" <owner-freebsd-questions at freebsd.org on behalf of arnabbhowmick08 at 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 at freebsd.org mailing list
>https://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list