Does Trisquel come with GCC pre-installed?

16 Antworten [Letzter Beitrag]
lap4fsf
Offline
Beigetreten: 10/12/2014

Recently I wrote a C code as part of a project.
when I tried to compile it using gcc command, from Trisquel 7.0 (Belenos), the bash gives this warning

bash: gcc: command not found

Does this means Trisquel don't have a GCC C compiler pre-installed with it?
Is there any workaround possible?

Michał Masłowski

I am a member!

I am a translator!

Offline
Beigetreten: 05/15/2010

Why not install it or the build-essential package?

Magic Banana

I am a member!

Offline
Beigetreten: 07/24/2010

Use the Synaptic package manager to install the "gcc" package.

lap4fsf
Offline
Beigetreten: 10/12/2014

Thank you, Micha} and Magic Banana.

But when I type "gcc" in Synaptic package manager, I have the following packages marked as installed;

gcc-4.6-base (GNU base-package)
gcc-4.8-base (GNU base-package)
gcc-4.9-base (GNU base-package)
libgcc1 (GNU support library)
libgomp1 (GNU GOMP support library)
libquadmath0 (GNU quad-precision math library)
cpp-4.8 (GNU C preprocessor)
cpp (GNU C preprocessor (cpp))

This is a fresh install, and I have not added/removed any packages. Should I select gcc(GNU C compiler) package(shown in figure)?
A bit more explanation is appreciable.

Screenshot from 2014-12-20 15:24:01.png
Magic Banana

I am a member!

Offline
Beigetreten: 07/24/2010

There is a package that is simply named "gcc". The first one in your screenshot. It depends on the default version of the GNU compiler. But you can install another version if you wish. "gcc-4.9" for instance.

Legimet
Offline
Beigetreten: 12/10/2013

gcc-4.9 is not available in the repos, except for the Go compiler gccgo-4.9.

tomlukeywood
Offline
Beigetreten: 12/05/2014

This is the simplest way to do it
1. open a terminal
2. type sudo apt-get install gcc
3. press enter
4. enter your password
5. press y and press enter
6. wait for it to install then Enjoy gcc!

davidnotcoulthard (nicht überprüft)
davidnotcoulthard

Install build-essential. It depends on GCC so it'll drag GCC into being installed as well.

Magic Banana

I am a member!

Offline
Beigetreten: 07/24/2010

It drags the "dpkg-dev" package and its dependencies too. Only Debian developers want that.

Calinou
Offline
Beigetreten: 03/08/2014

It's not like installing it will break your system. The point of `build-essential` is to have a set of useful packages for developers or users that compile programs in general.

So, yes, `sudo apt install build-essential` will install GCC.

Magic Banana

I am a member!

Offline
Beigetreten: 07/24/2010

Of course it will not break the system. Anyway, you are wrong to believe that "build-essential" is aimed to "compile programs in general". Just read the first line of the package description:

If you do not plan to build Debian packages, you don't need this package.

lap4fsf
Offline
Beigetreten: 10/12/2014

@ Magic Banana: Should I select gnu, gnu-4.9(deselecting 4.6 and 4.8) along with other packages from the Synaptic Package Manager and press "Apply" to install GCC?

I read somewhere that GCC maintainers only hosts the source code, whereby individual free software distributions bakes their packages from its flavour. In that case, where can I get the GCC binary package for Trisquel? Does it also depends on processor architecture? (Mine's is i386.)

Thanks in advance for any suggestions.

Magic Banana

I am a member!

Offline
Beigetreten: 07/24/2010

I told you: just install the "gcc" package to get the default C compiler. If you plan to compile C++ code too, install the "g++" package to get the default C++ compiler. If you plan to build software through a Makefile, install the "make" package. It is easy. You do not need to download and install individual packages by hand! The Synaptic package manager makes the process much easier and safer (against man-in-the-middle attacks in particular).

lembas
Offline
Beigetreten: 05/13/2010

/usr/bin/gcc is a symbolic link to the executable of which ever version of gcc you have installed.

If you wish to download the whole gcc package you can do so here (for Belenos on i386) http://packages.trisquel.info/belenos/i386/gcc/download

lap4fsf
Offline
Beigetreten: 10/12/2014

@lembas:

Thank you, dude. I will give it a try.

lembas
Offline
Beigetreten: 05/13/2010

Once you get the package it can be installed with

sudo dpkg -i /path/to/package
SuperTramp83

I am a translator!

Offline
Beigetreten: 10/31/2014

or you can nstall gdebi and then double click a deb file and follow simple instructions on a gui..
Although learning some basic terminal won't hurt you