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

63
votes
4answers
122k 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 ...
40
votes
3answers
76k 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
7k 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) ...
6
votes
4answers
21k 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.
1
vote
1answer
192 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 ...
41
votes
5answers
68k 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 ...
5
votes
1answer
14k 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 ...
20
votes
5answers
34k 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.
17
votes
4answers
36k 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
941 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
18k 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
4k 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
1k 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
5k 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 ...
2
votes
1answer
11k 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
14k 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
15k 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
88 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
247 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?
16
votes
2answers
131k 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 ...
9
votes
3answers
4k 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
3answers
21k 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
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.
8
votes
2answers
709 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, ...
6
votes
2answers
10k 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. ...
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
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
1answer
6k 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 ...
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 ...
0
votes
1answer
5k 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 ...
7
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
9k 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
236 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
742 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
88 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
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
133 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
117 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
1answer
3k 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

Compile 32 bit on 64 bitsystem

I'm trying to compile a 32 bit version of python on a 64 bit ubuntu system with the following configure command: CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 \ -Lpwd/lib32 -Wl,-rpath,/lib32 \ ...
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
1answer
31 views

Using mysql in C programming [on hold]

I installed ubuntu on a virtual machine.There,I installed mysql server(sudo apt-get install mysql-server) .This worked, because I could acces mysql-u root -p password. After that,I did : sudo apt-get ...
0
votes
1answer
720 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 ...
0
votes
1answer
167 views

No package 'ncurses' found [duplicate]

I'm trying to install XWiimote and they tell me to run ./autogen.sh in the installation notes . This is the output: zorin@Samsung-NP300E4Z-S03TH:~/Downloads/xwiimote-master$ ./autogen.shlibtoolize: ...
0
votes
2answers
1k 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 ...