# FreeBSD GCC installation (urgent help required)



## ifthenelse (Mar 7, 2016)

Hello, I am new to the forum I need help as I am given an assignment to install GCC compiler in FreeBSD 9.1.  Help will be appreciated. I am a beginner so I don't know much technical terms.

What I need to be answered:
- How to install GCC in FreeBSD 9.1 (just basic installation commands)
I have already created the vmware machine for FreeBSD but I can't install GCC compiler in it.


----------



## SirDice (Mar 7, 2016)

FreeBSD 9.1 has been End-of-Life since December 2014. Please stop using it. Use a supported version like 9.3, 10.1, 10.2 or the upcoming 10.3.


Handbook: Chapter 4. Installing Applications: Packages and Ports


----------



## wblock@ (Mar 7, 2016)

What type of assignment?  For school, for work?  What is the goal?


----------



## ifthenelse (Mar 7, 2016)

wblock@ said:


> What type of assignment?  For school, for work?  What is the goal?


It's for the institute, we need to install FreeBSD and then install GCC. And start coding in it, they have FreeBSD 9.1 version so we are using it.


----------



## ljboiler (Mar 7, 2016)

Any version of FreeBSD older than version 10 comes with GCC 4.2 as part of the main OS installation; if that works for your project, there would be nothing else to install.


----------



## Oldrancher (Mar 7, 2016)

ifthenelse said:


> its for the institute  , we need to install the freebsd and then install gcc , and start coding in it , they have freebsd9.1 version so we are using it.



As SirDice has suggested, your best approach is to download a current version of 
FreeBSD,  and install it.  For your learning purposes, I'd suggest installing it on a clean disk rather than VMWare.  A 160gb disk is big enough for this.

All of the directions for installing and configuring FreeBSD are in the Handbook.  
Gcc can be installed with `pkg` or built in /usr/ports().  Versions available on my recent 10.2 /usr/ports are:

```
lang/gcc
lang/gcc-aux
lang/gcc-ecj45
lang/gcc46
lang/gcc47
lang/gcc48
lang/gcc49
lang/gcc5
lang/gcc5-aux
lang/gcc5-devel
lang/gcc6-aux
lang/gcc6-devel
```
If you are familiar with general Unix or Linux administration from the command line,
FreeBSD is "just another Unix."  If not, you will have to learn basic Unix adminstration skills before you can use FreeBSD to develop programs.


----------



## wblock@ (Mar 7, 2016)

ifthenelse said:


> its for the institute  , we need to install the freebsd and then install gcc , and start coding in it , they have freebsd9.1 version so we are using it.


I don't know which institute you mean.  A school will normally provide some type of instructions.  A business will assume you already know the basics.


----------



## ifthenelse (Mar 7, 2016)

wblock@ said:


> I don't know which institute you mean.  A school will normally provide some type of instructions.  A business will assume you already know the basics.


Actually the tutor wants us to learn to install it from the scratch. And then to code, it is not provided in the computer lab so we have to do it by ourselves.


----------



## getopt (Mar 7, 2016)

If your tutor is demanding it, you should follow his pedagogical advice. This means you should make your own experience as a first step by trial and error. It is good practice here in this forum not to make your home work. Doing so would conditioning students to prefer nagging other people instead of learning what RTFM means. You are supposed to learn the learning. Just do it.


----------



## Oldrancher (Mar 7, 2016)

ifthenelse said:


> actually the tutor wants us to learn to install it from the scratch . and then to code, it is not provided in the computer lab so we have to do it by ourselves.



It now seems clear to me that you are a student in some sort of school, in courses being taught by a teacher.  You should turn to your teacher ("tutor") for advice on how to do your course work.  I can only presume that your teacher has established prerequisites for entry to the course, has set up a syllabus for teaching the course, and has specified recommended publications and other self-study support materials.

The people who participate in this forum are not, so far as I can see, generally prepared to construct syllabi for college-level courses in computer science topics, and I don't think that those of us who have done that are going to try to second-guess another teacher's methodologies.  You need to turn to your tutor for advice.

What I outlined above---set up an "install for test" computer, download and and prepare an installation CD, open up the Handbook, and see what happens when the computer plus install media was powered up---that is what I did to start learning FreeBSD.  I suspect that is the case for most of the people who read and post to this forum.  I suggest you do the same, and if you need further advice on basic installation beyond following the handbook steps, turn to your tutor.


----------

