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

51
votes
4answers
96k views

How to install gcc-4.8 in Ubuntu 12.04 from the terminal

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 ...
4
votes
7answers
5k 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) ...
36
votes
3answers
62k 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
4answers
18k 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.
38
votes
5answers
62k 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 ...
16
votes
3answers
33k 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 ...
8
votes
3answers
8k 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.
11
votes
1answer
12k 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 ...
4
votes
4answers
3k 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
1answer
502 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 ...
2
votes
1answer
946 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 ...
3
votes
2answers
11k 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
2answers
13k 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
14k 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
85 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
224 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?
12
votes
2answers
110k 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) ...
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 ...
8
votes
3answers
17k 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 ...
6
votes
5answers
13k 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 ...
5
votes
3answers
2k views

Downloaded g++ 4.8 but cant 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 ...
4
votes
1answer
3k 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.
3
votes
1answer
4k 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
1k 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
2answers
3k 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 ...
1
vote
1answer
5k 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 ...
0
votes
1answer
2k 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 ...
8
votes
2answers
616 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, ...
7
votes
3answers
13k 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
8k 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
214 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
737 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
82 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
2k 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
1k 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
1answer
109 views

cross compiling error for helloworld program

I have already created the amhello-1.0.tar.gz using this tutorial click to open now am trying to make cross compiling but error occurs. i am following this tutorial click to open after entering ...
1
vote
1answer
96 views

Compiling C source file without .c suffic

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

How can i downgrade GCC 4.7.2?

i want to downgrade GCC and G++ 4.7.2 to some older versions, 4.0 perhaps. Any assistance? I'm using Lubuntu ATM.
1
vote
2answers
4k 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 ...
1
vote
1answer
1k views

How to downgrade gcc from 4.4.4 to 4.2.1?

The newest Ubuntu (10.10) has gcc version 4.4.4, but I need 4.2.1 for compilation issues. The library that I'm using requires me to use 4.2.1. How can I downgrade the gcc to a specific version?
0
votes
2answers
150 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 ...
0
votes
1answer
164 views

Header files missing

I'm trying to compile a source code and I'm getting many errors indicating that header files are missing from my system checking sys/ioccom.h usability... no checking sys/ioccom.h presence... no ...
0
votes
1answer
800 views

“The program 'g++' can be found in the following packages”

I have g++ 4.6, 4.7 and 4.8 installed, but not g++ itself. I am using Ubuntu 12.04. If I do: g++ --version it says: The program 'g++' can be found in the following packages: * g++ * ...
0
votes
1answer
665 views

msp430/bin/ld: cannot find -lc

I installed successfully msp430-gcc 4.7.0 compiler. The compiler at the final stage of the linking process it shows me the following error for Ubuntu 12.04. msp430-gcc -mmcu=msp430f1611 ...
0
votes
1answer
960 views

Installing g++ on 8.04

I am running Ubuntu 8.04 (currently I do not have the option to upgrade due to hardware problems). I need to get g++ onto my installation but as this is no longer supported I am unable to use the ...
0
votes
2answers
8k views

How to uninstall gcc 4.6.2

I have gcc 4.6.2 installed (installed from tar source) in my ubuntu server 10.10 64 bit, I have also installed gcc 4.4.5. I want to uninstall gcc 4.6.2 and make my old gcc 4.4.5 default. How can I do ...
-1
votes
1answer
110 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 ...
-1
votes
2answers
77 views

compiling a c++ program

I tried to compile a cpp program through the terminal on 13.04 but got this message: npg@NPG-ideaPad-S210:~$ gcc -o comp-LCG.cpp The program 'gcc' can be found in the following packages: * gcc * ...