c compiling using clang

Steve O'Hara-Smith steve at sohara.org
Tue Apr 26 17:22:52 UTC 2016


On Tue, 26 Apr 2016 16:56:29 +0000
John Howie <john at thehowies.com> wrote:

> 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”.

	Just one nit "./a.out" and "./myfile" the current directory is not
usually in the path searched for executables.

-- 
Steve O'Hara-Smith <steve at sohara.org>



More information about the freebsd-questions mailing list