Questions tagged [gcc]
The GNU Compiler Collection is the standard compiler system used on many Unix-like operating systems, including Linux. Originally meant for compiling C programs, it can now also handle C++, Java and several other languages.
135
questions
177
votes
5
answers
431k
views
How do I use the latest GCC on Ubuntu?
I want to compile my program with the latest version of gcc.
Ubuntu 14.04 comes with gcc 4.8.2, however there's 4.9.0 available, moreover, I see that it is available as a package: gcc-4.9. I tried to ...
297
votes
10
answers
711k
views
How to choose the default gcc and g++ version?
So I have installed gcc-4.4 and gcc-4.3 (same for g++). Now as far as I remember there is a tool in Ubuntu which sets the symlinks for you if you just tell it which version you want. However it does ...
16
votes
8
answers
68k
views
Old version of gcc for new Ubuntu
Is there a repository containing packages for old versions of gcc, for the latest Ubuntu. I want to install gcc3 alongside gcc 4, for programs that need gcc3 specifically.
14
votes
8
answers
122k
views
Can I use a C/C++ compiler?
I shifted to Ubuntu 10.10 now I am facing problem to have C/C++ compiler. What are the possible ways so that I can use C/C++ compiler using all the libraries (like graphic, math, conio, stdlib, etc) ...
99
votes
2
answers
407k
views
How to install gcc-4.8
I checked the gcc version on my system.
It is currently at 4.6.3.
I read that gcc-4.8 is out.
I tried the following commands without success:
sudo apt-get install gcc (gcc is already the newest ...
136
votes
9
answers
505k
views
GLIBCXX_3.4.20 not found, how to fix this error?
Whey I try to run the program Layout Editor (available on this site) on Ubuntu 14.04.1 64-bit LTS I get the following output in the terminal:
$ layout
layout: /usr/lib/x86_64-linux-gnu/libstdc++.so.6:...
17
votes
2
answers
65k
views
Kernel doesn't support PIC mode for compiling?
I've been trying to compile the latest Linux v4.8.9 kernel on Ubuntu 16.10 and this error keeps popping up after I've made the default .config, modified it with menuconfig and ran make by itself. I've ...
80
votes
7
answers
283k
views
Getting + installing gcc/g++ 4.9 on Ubuntu? [duplicate]
How do I install the latest version of gcc and g++?
I am using a variety of C++11 and C++1y features; which is why I need this.
12
votes
1
answer
18k
views
How to use multiple instances of gcc?
I have both gcc 4.7.3 and 4.8.1 installed
But on running gcc --version I get
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see ...
74
votes
3
answers
211k
views
How to cross compile for ARM?
How do I set up GCC for cross compiling for the ARM processor? The host would be on x86_64 ( AMD64 - Ubuntu 12.04 ) and the target would be ARM (Raspberry Pi as well as Pandaboard - will do separate ...
62
votes
3
answers
129k
views
Install gcc-8 only on Ubuntu 18.04?
I just installed Lubuntu 18.04 LTS. There are two options for installing gcc: gcc-7 and gcc-8. Both are available from apt-get install out of the box.
Even after I installed gcc-8, the system is ...
50
votes
4
answers
215k
views
How to install clang++?
I'm having trouble getting clang++ to work as I compile my code. Specifically, I'm getting a make: clang++: Command not found error.
I've run sudo apt-get install llvm, and also sudo apt-get install ...
35
votes
4
answers
97k
views
How to install gcc-7 or clang 4.0?
I want to try C++17 features and I want to install standard compliant compiler (preferably GCC). I'm totally new to Linux and Ubuntu and I simply don't understand a lot.
I tried to follow https://...
8
votes
3
answers
69k
views
How to compile and run C programs avoiding "bash: ./a.out: Permission denied" [duplicate]
I have installed GCC compiler by installing the build-essential package.
After the installation I wrote a simple C program. I tried to run it with the following command:
gcc First.c
./a.out
but I'm ...
8
votes
2
answers
25k
views
How to use GCC 4.7 in place of 4.6?
So I'm working on a project and I wanted to use some C11 features for C. To use those features GCC 4.7 is required, so I went to synaptic and looked up 4.7, and I found the packages gcc-4.7-base so I ...
1
vote
1
answer
2k
views
Problem installing g++ ccompiler on Ubuntu 14.04
I tried to install g++ using packages from another user. offline..but there were errors.
After connecting to the net I tried to install using sudo apt-get install g++, but it gave the following output:...
0
votes
2
answers
2k
views
NS2 compilation errror in ubuntu
gcc-4.4 -c -g -O2 -DNDEBUG -DUSE_SHM -DHAVE_UNISTD_H=1 -I. -I/home/akhil/ns-allinone-2.35/include -I/home/akhil/ns-allinone-2.35/include -I/home/akhil/ns-allinone-2.35/include -I/include otcl.c
make: ...
62
votes
2
answers
122k
views
install gcc-9 on Ubuntu 18.04?
gcc-9 is just released.
I was wondering if there is a repository that allows me to install gcc 9 on Ubuntu 18.04 LTS (bionic)?
There seems to be repositories supporting disco:
https://packages....
50
votes
4
answers
114k
views
How do I install gcc 4.7?
I wish to install gcc 4.7 so that I can use some c++11 features.
I downloaded the source, ran ./configure and was told I needed GMP. Downloaded the code for that, hit ./configure and was told I ...
19
votes
3
answers
127k
views
My program cannot run with "command not found" error
I just switched from Windows to Ubuntu 11.10.
I wrote the following code in C with the text editor and saved it as HelloWorld.c in Documents.
#include <stdio.h>
int main()
{
printf("Hello ...
13
votes
1
answer
56k
views
Install gcc 5 on Ubuntu 18.04
I have gcc 7.3.0 on Ubuntu 18.04.
But I am working on a project where I need gcc less than version 6.
When I tried to install gcc 5.4 using sudo apt install gcc-5.4, I got this error:
Reading package ...
11
votes
4
answers
21k
views
Ubuntu 17.10 Upgrade Broke VMWare Workstation 12.5
Hi after upgrading to Ubuntu 17.10, vmware is now not starting.
I get the message:
/usr/lib/vmware/bin/vmware-modconfig: Relink `/lib/x86_64-linux-gnu/libbsd.so.0' with `/lib/x86_64-linux-gnu/...
5
votes
1
answer
8k
views
Trying to install gcc-8 and g++-8 on Ubuntu 22.04
Before you say it's a duplicate, the wget links in this answer are dead, and I need g++-8 too, not just gcc-8: How to resolve the error : 'Package gcc-8 has no installation candidate' ? I'm trying to ...
5
votes
1
answer
11k
views
How can I force an older version of g++ if I have a newer version?
g++ --version on my home machine reads 7.4.0, but a server I frequently do work on shows 4.8.5. Their servers don't support -std=c++11 compiler flags yet my home machine does. The most recent flag it ...
58
votes
3
answers
368k
views
Install gcc on Ubuntu 12.04 LTS
When I try to install gcc on Ubuntu 12.04 LTS Server with apt-get install gcc, I get the following error:
The following packages have unmet dependencies:
gcc : Depends: cpp (>= 4:4.6.1-2ubuntu5) ...
14
votes
2
answers
46k
views
Ubuntu 20.04 - gcc version lower than gcc-7
I recently upgraded my Ubuntu version to the latest 20.04 release. Some of my earlier projects (developed on 16.04) were compiling just fine with a gcc version of 5 (gcc-5.4.0).
The default version in ...
13
votes
1
answer
40k
views
Disable PIE and PIC defaults in gcc on ubuntu 17.04?
I have just been painfully discovering that gcc apparently generates -fpic code by default and links with -fPIE by default (On ubuntu 17.04). This completely screws up thousands of tests I run with ...
9
votes
1
answer
3k
views
build-essential is not installed by default in 18.04. How to install network drivers offline?
We have a serious problem with new installations on laptops that have only a wireless network device requiring some network drivers, like bcmwl-kernel-source.
Many laptops don't have an Ethenet port ...
6
votes
2
answers
29k
views
How to use an older version of GCC
I'm using Ubuntu 18.04.4 LTS, and I'm trying to compile a MATLAB-based program (SPM12), following their online instructions, and I believe I'm running into a problem of having a GCC version that is '...
4
votes
3
answers
6k
views
Compiling C codes in Ubuntu
I'm a rookie programmer and trying to compile a C code in Ubuntu. I already installed GCC. How do I proceed from here?
3
votes
3
answers
12k
views
'undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' while compiling bochs
I'm trying to compile bochs with this command:
./configure --with-x11 --with-wx --enable-ne2000 --enable-iodebug --enable-disasm --enable-debugger --enable-e1000 --enable-usb --enable-pci
it works, ...
37
votes
2
answers
53k
views
How can I install and use gcc 6 on xenial? [duplicate]
I wish to test existing software with gcc 6, to ensure that it will work when the transition takes place.
How can I install gcc 6? Is there a ppa available?
Can I just do a "CC=gcc-6 make" ?
...
32
votes
3
answers
67k
views
Trouble compiling a 32 bit binary on a 64 bit machine
I'm trying to compile a c program as a 32 bit binary instead of 64 bit. I started by just adding -m32 and got some errors. Googling around a little I came across a note to install ia32-libs. ...
27
votes
2
answers
277k
views
How to compile a C program that uses math.h?
I am having problems in math.h header file and when I use square root function as in sqrt(d). But my compiler is not supporting this. Please advise me about this problem.
My Ubuntu version is 2012.
21
votes
2
answers
59k
views
cannot find -lgcc_s
I am attempting to compile a program with g77 and I keep getting the following error:
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
I saw on another forum that this is related ...
17
votes
2
answers
49k
views
Installing gcc-7 (and newer packages) in Ubuntu 16.04 [closed]
I am running Ubuntu 16.04 LTS and I want to install a newer version of GCC, specifically gcc-7 which released May 2, 2017. There is a package for it in the Toolchain test builds ppa, but the Ubuntu ...
16
votes
3
answers
135k
views
configure: error: C compiler cannot create executables
I was trying to install rvm using \curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles. It worked fine until I got a configure error:
Error running './configure --...
15
votes
3
answers
45k
views
How to disable -Werror=date-time/macro "__DATE__" might prevent reproducible builds
I am trying to compile a driver for a Netis WF2190 adapter.
Yes, I just downloaded the latest from them.
How can I disable the -Werror=date-time in the build? I can't find it anywhere in the build ...
15
votes
3
answers
25k
views
Downloaded g++ 4.8 from the PPA but can't set it as default?
I have downloaded g++ 4.8 on Ubuntu 12.10 by doing:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8
but when I do:
sudo update-alternatives --...
12
votes
3
answers
32k
views
How to activate gcc 4.7 version?
I have gcc 4.6.3 installed:
gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
I have installed newer version:
apt-get install gcc-4.7
But i still get result "gcc 4.6.3" when I type gcc --...
10
votes
2
answers
31k
views
Update GCC to the 6.3 version [closed]
I want to use some C++ features only available in more recent versions of the language. The problem is Ubuntu 15.04 (Vivid Vervet) has 4.9.2 installed and looking at the output I get from apt-get ...
8
votes
1
answer
4k
views
Compiling C source file without .c suffix
Let hello_world be a valid C source file. When I try to compile I get
gcc hello_world // hello_world: file not recognized: File format not recognized
I know I could rename to have .c suffix, but if ...
7
votes
2
answers
12k
views
Can't run my hello world in C
I'm trying to write a basic program in C using gedit or sublime text (which I prefer), but no matter what I do when I try to compile or run, or even while writing, I have no option to use 'stdio.h' or ...
7
votes
4
answers
5k
views
14.04 to 16.04 LTS gcc-5-base downgrade
I don't know if anyone can help me with gcc-5-base issue. Ever since I upgraded my 14.04 LTS to 16.04 LTS, I have packages with unmet dependencies.
The following packages have unmet dependencies:
...
6
votes
2
answers
3k
views
Emacs toolbar icons missing in Ubuntu-16.10, struggle to compile emacs24 and 25
I'm writing to see if you have tried to compile Emacs lately. I want to compile emacs-25.1 but hit a segmentation fault. If you wonder why I want to compile, or why I'm asking here, read on...
I ...
6
votes
2
answers
11k
views
Install gcc 7.1 on Xubuntu 16.04 and make it default
I want to install the latest gcc package (7.1) on Xubuntu 16.04.4. I have successfully installed the package following the instructions given here from GAD3R.
The problem is that when I run:
gcc --...
5
votes
5
answers
22k
views
How do I install gcc-4.3?
Is there and easy way to install gcc-4.3 on Oneiric ?
I really need it because matlab depends on i for the creation of mex-files
I tried changing all my resopistories back to Maverick just to install ...
4
votes
2
answers
25k
views
Install gcc7 on ubuntu 22.04
I would like to install gcc-7 on Ubuntu 22.04.
I used:
sudo apt-get install gcc-7 g++-7
But got the error:
Reading package lists... Done
Building dependency tree... Done
Reading state information... ...
3
votes
2
answers
2k
views
python 2.7.9 backport to trusty (14.04)
I try to backport Python 2.7.9 from vivid to trusty but when launchpad build this pakage there is an build error.
I create my backport :
backportpackage -d trusty -u ppa:splanquart/python http://...
2
votes
3
answers
4k
views
Ubuntu 22.04.3 - VMware Kernel Module Updater
Ran into the GNU C Compiler (gcc) version 12.3.0 was not found.
I have seen this issue before and have resolved it, however when I run the commands below I still receive the request for GCC. Is the ...