View Full Version : Help installing emacs, getting a "C compiler cannot create executables" error

September 14th, 2008, 04:12 AM
I did some google work and couldn't really come up with anything. Whenever I type ./configure this is what I get:

sam@sam-laptop:~/Desktop/emacs-22.3$ ./configure
checking build system type... i686-pc-linux-gnulibc1
checking host system type... i686-pc-linux-gnulibc1
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

September 14th, 2008, 04:19 AM
To compile stuff, you need to install the build-essential package.

Having said that, I think you would be better off installing emacs either from the official repository or from Vassalotti's ppa repo: http://peadrop.com/blog/2007/09/17/pretty-emacs-reloaded/

The advantage of using Vassalotti's version is the fonts will look significantly better.
(You'll be able to use ttf fonts).

By the way, Vassalotti's emacs-snapshot is version, which is newer than the source you seem to be compiling.

The page that referenced above seems to not be updated for Hardy. However, his ppa has hard packages available:


Therefore, if you wish to try emacs-snapshot instead of the official repo version, follow his instructions except replace gutsy with hardy:

deb http://ppa.launchpad.net/avassalotti/ubuntu hardy main
deb-src http://ppa.launchpad.net/avassalotti/ubuntu hardy main

September 14th, 2008, 04:21 AM
Do U have gcc installed (the GNU C compiler)? Is there a reason your installing Emacs yourself and not installing the Ubuntu packages?

September 14th, 2008, 04:23 AM
I haven't downloaded the gnu c compiler so if it wasn't part of an update then no I don't have it. The reason why I'm not installing an ubuntu package is due to ignorrance and to answer the other guys question thats the link supplied by the emacs website...

September 14th, 2008, 04:23 AM
Surely there must be a better way to install emacs. Have you tried getting it from the repos:

sudo apt-get install emacs

If you want to do C s/w development, also get the GCC compiler:

sudo apt-get install build-essential

P.S. There are many sub-packages available for emacs. You can find a list of them (and many others) here:

September 14th, 2008, 04:50 AM
I got it from the repo, I didn't realize I could do that. *nub alert*

now I just have to figure out the steep learning curve of emacs...

September 14th, 2008, 05:08 AM
What is your compelling reason to use emacs?

You can pretty much accomplish the same s/w development task using gedit and the command-line to compile/link your application.

Emacs, though still be used by some, it not en-vogue as it once was. Some swear by Eclipse, others like myself, prefer vim and the command-line (and Makefiles when dealing with larger projects).