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.

learn more… | top users | synonyms

65
votes
4answers
154k 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 ...
53
votes
3answers
101k views

Choose 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 ...
5
votes
7answers
11k 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) ...
37
votes
6answers
88k views

Getting + installing gcc/g++ 4.9 on Ubuntu?

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.
7
votes
4answers
25k 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.
2
votes
3answers
1k views

How to Compile and Run C program

I have installed GCC compiler using Install the build-essential command. after the installation I wrote a simple c prgm. I tried to run with following command: gcc First.c ./a.out but I'm getting ...
1
vote
1answer
498 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 ...
44
votes
5answers
75k 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 ...
7
votes
1answer
17k 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 ...
15
votes
3answers
30k views

How do I use the latest gcc 4.9 on Ubuntu 14.04

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 ...
18
votes
4answers
42k 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 ...
4
votes
1answer
2k 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 ...
14
votes
1answer
31k views

Cross-Compile for ARM?

How do I set up GCC for cross compiling for the ARM processor? The host would be on x68 ( AMD64 - Ubuntu 12.04 ) and the target would be ARM ( Raspberry Pi as well as Pandaboard - will do separate ...
8
votes
3answers
30k 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 ...
4
votes
4answers
5k views

How do I install ALL development libraries?

I want to preinstall all the libraries one could ever need onto a system so someone building something would always have the libraries available. Like in a computer lab where users are not root. I ...
3
votes
2answers
2k views

Bochs Compiling Error AGAIN

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, ...
1
vote
3answers
3k views

Can't install gcc 4.8, dependency issues

I tried downoading 4.8 for 12.04 from https://launchpad.net/~ubuntu-toolchain-r/+archive/test/+packages (I did not find for 13.04 as is mentioned here: How to install gcc-4.8 in Ubuntu 12.04 from the ...
1
vote
2answers
7k views

Installing missing package that provides Xm/Xm.h

I'm compiling a software package that requires a header file. The header file is missing from my Ubuntu 11.10 (64-bit) installation. During the compilation using make, gcc and gfortran, I receive ...
10
votes
1answer
71k 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 ...
2
votes
1answer
14k 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 ...
1
vote
2answers
16k views

Is it possible to downgrade gcc 4.6.1 to 4.4.x?

I've tried the following: sudo apt-get remove gcc sudo apt-get install gcc-4.4 But this does not work, running gcc --version gives a 'No such file or directory' error.
5
votes
5answers
16k 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 ...
2
votes
1answer
2k views

Installing gcc from Kubuntu DVD

I am having a hard time with a Kubuntu 12.04 install that does not have an internet connection. In order to build the ethernet driver, I need gcc. I installed from the DVD, and I have gcc-4.7-base ...
1
vote
1answer
99 views

What gcc version do I need?

I have installed ns-2.28 on ubuntu 12.04. My kernel version is 3.2.0-29-generic-pae. What gcc version matches my ns-2.28 & 3.2.0-29-generic-pae?
1
vote
1answer
266 views

How to install 64-bit libraries on 32-bit system?

I need to cross-compile for 64-bit architecture on a 32-bit platform (using gcc-multilib and -m64 flag). For this I need to install 64-bit versions of the dependent libraries. How do I do that?
18
votes
2answers
162k 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) ...
11
votes
3answers
6k 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 ...
8
votes
1answer
4k views

How to speed up compilation of Ubuntu apps (make, cmake, gcc)

I am compiling some programs here and I have 4 cores. Is there a way to tell make, cmake or gcc to compile using all cores or something to that affect.
5
votes
4answers
6k views

Can't build gcc anymore since upgrade to 11.10

On Monday I've upgraded to from Ubuntu 11.04 (my initial installation) to 11.10 and now I can't build gcc from source anymore. Since I forgot to uninstall the gcc package before the upgrade, Ubuntu ...
6
votes
2answers
12k 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. ...
6
votes
5answers
14k views

Linking problems after updating to 11.10

Right now I am having difficulties linking a project I am working on with gcc4.6 in ubuntu 11.10. Before the distribution upgrade everything linked fine and it still compiles/links on the other ...
3
votes
2answers
4k views

Building a static version of Python?

I tried asking this question at StackOverflow, but the dead silence that followed made me wonder if some more Ubuntu-specific expertise might be required. I am trying to build a static version of ...
4
votes
1answer
10k 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: ...
3
votes
1answer
5k views

How to compile & install Emerald window manager in Ubuntu 13.04 64bit?

Please give me directions to compile & install Emerald specifically in Raring Ringtail 64bit edition. I've tried to compile it from the source many times, but had no luck.(Compile log : ...
3
votes
3answers
2k views

Are gcc versions tied to kernel versions?

Is there any link between gcc versions and the version of a kernel ? Specifically, would I be able to install a very old version of gcc onto the latest kernel. Alternatively would I be able to build ...
2
votes
1answer
8k views

How to install GCC 4.7 on Lubuntu 11.10?

I installed Lubuntu 11.10 and I installed build-essential with this command: sudo apt-get install build-essential Now I have gcc 4.6 I read on some forum that adding the next PPA I'll be able to ...
1
vote
1answer
1k views

Using gcc 3.4 on Ubuntu 14.04

By exactly following this post, I was able to install gcc 3.4 on a fresh install of Ubuntu 14.04. But, when I try to compile a program, it fails with the following error: /usr/bin/ld: cannot find ...
1
vote
1answer
4k views

cannot install lxml in virtualenv (python)

I cannot install lxml. In system i have python-lxml package, but i need other... Please help, if you can - my task is install lxml for development in virtual enviroment using virtualenv. I found this ...
0
votes
1answer
7k views

Terminal commands for installing g++ 4.8?

Could somebody please advise how I could install g++ 4.8 ? I understand its not an official release yet (and that I would need to manually download a file) but I get internal compiler bug issues with ...
9
votes
2answers
886 views

Can't compile with GCC on Ubuntu 12.04

I'm trying to compile and run the below C program on my Ubuntu & Windows machines with both GCC & VC9. However, I'm facing below issues: On Ubuntu machine: GCC compiles fine, but when run, ...
8
votes
3answers
14k views

gcc no longer works after upgrade

As an example: hsmyers@ubuntu:~/c_dev$ cat hello.c #include <stdio.h> int main(int argc,char **argv) { printf("Hello World!\n"); return 0; } hsmyers@ubuntu:~/c_dev$ gcc -c -o hello.o hello.c ...
6
votes
2answers
10k views

Ubuntu 13.04 with gcc/g++/gfortran 4.8 by default?

I plan to download and install Ubuntu 13.04 and I would like to have two compilers on my system. First question: what is the version of gcc/g++/gfortran shipped with ubuntu 13.04 ? (is it 4.7.3 ?). ...
4
votes
1answer
252 views

Reverting problems caused by checkinstall with gcc build

I recently downloaded the GCC 4.6.2 source in order to play around a bit with C++11. Having been told about checkinstall and its usefulness in installing programs from source, I created a Debian ...
3
votes
1answer
748 views

Will gcc be upgraded to 4.5.* in one of the 10.04.* releases?

I don't quite understand how the LTS releases work. Will gcc be updated to the newer 4.5 version or will it remain 4.4 and I'll have to wait for 11 before seeing 4.5?
2
votes
1answer
6k views

-std=c++11 not recognized on gcc 4.8.1

I just followed an answer to this question to update my gcc version to 4.8. 1 on Ubuntu 12.04, which I thought would support C++11. However it does not seem to. When I try to compile something with ...
2
votes
1answer
9k views

Is there any library similar to <conio.h>?

I used the IDE DEV C++ to compile C programs on Windows and I used the libraries and , but now I use Ubuntu and downloaded the Codeblocks, but it does not have these libraries. I just wanted to use ...
2
votes
1answer
110 views

Error installing SHA

I'm trying to install SHA using the following command perl -MCPAN -e 'install Digest::SHA' I also tried using: sudo cpan 'install Digest::SHA' But i'm getting a linker error: ...
2
votes
1answer
3k views

error in installation of gcc on ubuntu Ubuntu 12.04

I want to install gcc on a ubuntu machine but got the following errors: t@lab45:~# apt-get install build-essential Reading package lists... Done Building dependency tree Reading state ...
2
votes
2answers
2k views

gcc Unable to exec gcc.real: No such file or directory

./configure checking for gcc... gcc checking whether the C compiler works... no configure: error: in `/home/mob/freeglut-2.8.0': configure: error: C compiler cannot create executables See ...
1
vote
3answers
5k views

How do you fix a gcc compile 127 error? sudo apt-get install g++ doesn't work

*emphasized text*when I try to run a program I get the following error. ubuntu@ubuntu-VirtualBox:~/Desktop$ make g++ -Wall -Wno-switch -I. -g -c -o pass.o pass.cpp make: g++: Command not found ...