# Time for old faithfull test



## Johnny2Bad (Dec 6, 2010)

Hi folks,
Okay I want to do the old faithfull test of a c++ hello world program on FreeBSD. What compiler should I use, and is there anything I should be aware of?

Thanking you in advance,
Jonathan.


----------



## graudeejs (Dec 6, 2010)

*CC* for c++
*cc* for c

Both are gcc 4.2.1 included with FreeBSD


----------



## fronclynne (Dec 6, 2010)

I don't know about historical incantations, but 
	
	



```
> ls -il `which CC g++ c++`
1208576 -r-xr-xr-x  3 root  wheel  199800 Nov 30 21:13 /usr/bin/CC
1208576 -r-xr-xr-x  3 root  wheel  199800 Nov 30 21:13 /usr/bin/c++
1208576 -r-xr-xr-x  3 root  wheel  199800 Nov 30 21:13 /usr/bin/g++
```
HTH


----------



## graudeejs (Dec 6, 2010)

AFAIK, in old days there was cc compiler, which was replaced by gcc, but the name remained for backward compatibility (and probably some standards says, that there should be cc)


----------



## expl (Dec 6, 2010)

killasmurf86 said:
			
		

> AFAIK, in old days there was cc compiler, which was replaced by gcc, but the name remained for backward compatibility (and probably some standards says, that there should be cc)



cc is just a slink for default c compiler on the system (on unix and unix like systems), so build scripts donÂ´t have to find out what compiler should they use on their own. Even though GCC kinda became the standard due to effort of the GNU community. This is also useful if you have several versions of GCC installed and want to switch between them without editing makefiles, but sometimes you also have to edit link of "gcc" itself due to nature of some buildtools.


----------



## graudeejs (Dec 6, 2010)

What I say, is still True


----------



## Johnny2Bad (Dec 7, 2010)

Well regardless of the debates, CC worked fine for my hello world test program.

Thanks heaps,
Jonathan.


----------



## UNIXgod (Dec 7, 2010)

AFAIK cc was always a link. Go read:

https://secure.wikimedia.org/wikipedia/en/wiki/Portable_C_Compiler


----------

