You are not logged in.

#1 2024-04-20 18:22

FlexQ4
Member
Registered: 2017-02-19
Posts: 148

How to use the (g)cc Compiler

Hello,
having installed Q4OS with the TDE and the basic option i found gcc-10 compiler already installed (in Synaptic). I tried:

me@flex:~\> whereis gcc
gcc: /usr/lib/gcc /usr/share/gcc
me@flex:~\> which gcc
me@flex:~\> export PATH=$PATH:/usr/lib/gcc
me@flex:~\> export PATH=$PATH:/usr/share/gcc
me@flex:~\> which gcc
me@flex:~\> gcc demo.c -o demo
bash: gcc: Kommando nicht gefunden. [comand not found]
me@flex:~\>  

"which gcc" still shows an empty result! What ist still wrong or missing here?
Thanks

Offline

#2 2024-04-22 16:26

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,259
Website

Re: How to use the (g)cc Compiler

What Q4OS edition are you using ? You may only need to install "gcc" package:
$ sudo apt install gcc

Offline

#3 2024-04-22 20:47

FlexQ4
Member
Registered: 2017-02-19
Posts: 148

Re: How to use the (g)cc Compiler

Thanks a lot - that helped (on 4.12)!
But what is gcc-10 then? According to the description in synaptic it should be a more recent version of gcc!?

Offline

#4 2024-04-23 07:51

hchiper
Member
From: Belgium
Registered: 2020-07-28
Posts: 400

Re: How to use the (g)cc Compiler

After installation, gcc is a symbolic link to gcc-10, which in turn is a symbolic link to the real compiler, which depends on your system; on my system it is x86_64-linux-gnu-gcc-10 ... Admit it is easier to type gcc at the command line prompt than x86_64-linux-gnu-gcc-10 to run the compiler smile


Q4OS machines: [Samsung R519 - Pentium T4200 2.0 GHz - 4 GB RAM - 500 GB SSD] & [Sony Vaio - Pentium P6000 1.87 GHz - 8 GB RAM - 500 GB SSD]

Offline

#5 2024-04-23 08:42

FlexQ4
Member
Registered: 2017-02-19
Posts: 148

Re: How to use the (g)cc Compiler

Ahh ok, and this explains why the size of the gcc package was so astonishingly small !!

Offline

Board footer

Powered by FluxBB