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.
1,196
questions
296
votes
9
answers
705k
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 ...
176
votes
5
answers
428k
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 ...
136
votes
9
answers
502k
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:...
99
votes
2
answers
406k
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 ...
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.
74
votes
3
answers
209k
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
2
answers
121k
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....
62
votes
3
answers
128k
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 ...
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) ...
55
votes
3
answers
186k
views
"fatal error: openssl/opensslv.h: No such file or directory" compiling mitmproxy
I'm trying to install the mitmproxy package via pip like this:
$ sudo pip install mitmproxy
It terminates with following error message:
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -...
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 ...
50
votes
4
answers
214k
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 ...
44
votes
5
answers
332k
views
how to fix configure: error: C compiler cannot create executables
used
./configure DFLAGS="-03"
and this is the config.log
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-...
43
votes
2
answers
143k
views
gcc: error trying to exec 'cc1plus' : execvp: No such file or directory
I'm a newbie but adventuresome. I'm tri-booting Windows, Fedora, and Ubuntu 14.04 LTS (all 64). Learning but not using dpkg, apt, and apt-get. Starting to study C++ using Ubuntu (the only one with gcc ...
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" ?
...
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://...
34
votes
4
answers
101k
views
How to install arm-none-eabi-gdb on Ubuntu 20.04 LTS (Focal Fossa)
I tried to install arm-none-eabi-gdb as a part of gcc-arm-embedded. I added PPA:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
and executed:
sudo apt install gcc-arm-embedded
It ...
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. ...
30
votes
2
answers
51k
views
What exactly does gcc-multilib mean on Ubuntu?
After hanging long time with older Ubuntu (v.12) I'm updating to v.16 and am very confused with mentions of "gcc-multilib".
Is this actually Apple's "fat binaries" or "universal binaries" model ...
28
votes
2
answers
161k
views
How can I update gcc 5.3 to 6.1? [duplicate]
After installing Ubuntu 16.04 LTS, I found that gcc 5.3 installed by default but I don't receive any updates to gcc. I opened up GCC website and I found the new release 6.1. How do I update?
Output ...
28
votes
4
answers
35k
views
gcc won't link with -m32
Trying to compile even the simplest (int main(){}) program with -m32 on a 64-bit system fails:
$ gcc -m32 test.c
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when ...
27
votes
2
answers
275k
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.
26
votes
4
answers
149k
views
cannot find crti.o: No such file or directory
When I want to make gcc 4.1.2 (ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.bz2) on my ubuntu 12.04 (x86_64). The current active gcc is 4.6.2.
I did:
./...
25
votes
2
answers
83k
views
Building a 32-bit app in 64-bit Ubuntu
After hours of googling, I decide to give up and ask you experts. I am trying to build a 32-bit application (xgap if anyone interested) in my 64 Ubuntu 11.10. I added the CFLAGS=-m32 and the LDFLAGS=-...
24
votes
3
answers
178k
views
sudo apt-get install libstdc++
When i try to install libstdc++ using:
sudo apt-get install libstdc++
I am getting the below error in ubuntu. Do you have any idea about it?
The following packages have unmet dependencies:
libstdc+...
24
votes
2
answers
32k
views
Undo update-alternatives
I had to run the command sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20, but unfortunately I misstyped and wrote sudo update-alternatives --install /usr/bin/gcc gccc /usr/bin/...
23
votes
5
answers
78k
views
How to update gcc to the latest version(in this case 4.7) in Ubuntu 10.04?
I have Ubuntu 10.04 32-bit with gcc 4.4.3 currently installed on it. I want to upgrade it to gcc/g++ 4.7 (I am looking for C++ 0x support)
How to update using Ubuntu Package Manager:
apt-get upgrade/...
22
votes
1
answer
1k
views
bfd.h should have included libiberty/ansidecl.h in Ubuntu 14.04?
binutils package seems to be changed, as it includes directory of libiberty.h has moved to /usr/include/libiberty, thus there is possible a wrong include in bfd.h regarding ansidecl.h.
Getting those ...
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 ...
20
votes
3
answers
116k
views
How can I check that GCC is installed correctly?
I have installed GCC with apt-get.
How can I check that it is installed correctly and which version?
19
votes
3
answers
126k
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 ...
19
votes
4
answers
37k
views
Cannot find -lgfortran
I'm trying to install a package in R (package "ks"). It fails with error message:
/usr/bin/ld: cannot find -lgfortran
I've already installed the Ubuntu package build-essential:
sudo apt-get install ...
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 ...
17
votes
1
answer
25k
views
What are the GCC and clang versions available in Ubuntu 18.04? [duplicate]
In the new Ubuntu 18.04:
What's the default GCC version (with which the binaries were built)?
What GCC versions are available as separate packages (and what minor version is installed if I install ...
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
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.
16
votes
5
answers
41k
views
Where's my /usr/include/sys directory?
I recently upgraded from Kubuntu 12.04 to 13.04, a complete reinstall.
Using gcc 4.7.3. I compiled some programs to discover there is no /usr/include/sys directory. That is, types.h, stat.h, etc, ...
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
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 --...
15
votes
6
answers
100k
views
C stdio.h no such file or directory
gcc worked perfectly fine until I updated to Ubuntu 16.04 and now when I run:
gcc file.c
an error shows up:
file.c:1:18: fatal error: stdio.h: No such file or directory
compilation terminated.
I ...
15
votes
4
answers
37k
views
How to install g++ 5.1 on Ubuntu desktop 15.04 64-bit?
I'd like to experiment with the new GCC 5.1 C++ compiler on Ubuntu.
So, I downloaded and installed Linux Ubuntu desktop 15.04 64-bit in a virtual machine.
Then, in the terminal, I entered the ...
15
votes
1
answer
55k
views
/bin/bash: g++: command not found error 127
I was trying to install the software quicknet from a tar.gz file.
After running ./configure, when I tried running make, it showed the following error:
g++ -I. -I. -c QN_args.cc
/bin/bash: g++: ...
15
votes
1
answer
12k
views
Compiling C++20 program that uses modules with Ubuntu 22.04
I'm trying to run a simple program:
import <iostream>;
int main()
{
std::cout << "Hello, World!" << std::endl;
return 0;
}
I've checked, and supposedly I've already have ...
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 ...
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) ...
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 ...
14
votes
2
answers
2k
views
How can I get GCC 4.7 installed on Precise?
The latest version of GCC in the Precise archives is 4.6.3. However, GCC 4.7 adds support for some newer C++11 features (like delegating constructors). Quantal's package archives have GCC 4.7.2 ...
14
votes
2
answers
67k
views
Updating to latest gcc and g++ on Ubuntu 16.04
I recently tried to downgrade to gcc 4.7 since a cfd code I was working on didn't compile with the latest gcc version. But after many errors and the code still not compiling I gave up and would like ...
14
votes
1
answer
21k
views
GDB crashes with: ImportError: No module named libstdcxx.v6.printers
I have a problem with GDB. Whenever I try to debug any C++ program, just after running it, GDB gives this error:
(gdb) run
Starting program: /home/errikos/Workspaces/tests/a.out
Traceback (most ...
13
votes
4
answers
46k
views
How do I install gcc 4.8.1 on Ubuntu 13.04?
I have a 64 bit UBUNTU 13.04
running gcc --version shows me gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
But on May 31 2013 gcc 4.8.1 was released . And I don't know how to install it ..
Can someone ...