Problem compiling Emacs (no x development libraries were found)

5,376

Solution 1

What version of Ubuntu do you have? I downloaded the tar'd source from the gnu emacs site. I ran :

./configure

It told me that I need libXpm and libgif/libungif. I installed libXpm-dev and libgif-dev with :

sudo apt-get install libxpm-dev libgif-dev

After I installed those, I reran configure (./configure), and then I was able to build it.

I now have a binary for emacs in my emacs-25.1/src directory called emacs-25.1.1, and it works.

Solution 2

This is the command I'm using to install emacs 26.3 on ubuntu 18.04:

$ sudo apt-get install build-essential texinfo-doc-nonfree install-info info libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses5-dev libxpm-dev automake autoconf libgnutls28-dev

For details please see Compile error: checking for libXaw... configure: error: No X toolkit could be found

Please note that I simply had to change libncurses-dev to libncurses5-dev, add texinfo-doc-nonfree install-info info and libgnutls28-dev

Share:
5,376

Related videos on Youtube

kanr
Author by

kanr

Web Development and Django, Java Programming, C++ Programming Completed Projects: (Musical Instruments information (website) www.instrum.co.uk) Qualifications : ( BSc Computer Science (2014), City and Guilds Diploma - ICT System Support Level 2 (2015), City and Guilds Diploma - ICT Systems and Principles Level 2 (2015) )

Updated on September 18, 2022

Comments

  • kanr
    kanr over 1 year

    I'm still new to Ubuntu/Linux use

    I'm installing Emacs (version 25.1) that I've downloaded source files, uncompressed and extracted the files using tar

    It seems I have to use ./configure. Computer works for a while and gives me this result:


    checking for X... no
    checking for X... true
    configure: error: You seem to be running X, but no X development libraries
    were found.  You should install the relevant development files for X
    and for the toolkit you want, such as Gtk+ or Motif.  Also make
    sure you have development files for image handling, i.e.
    tiff, gif, jpeg, png and xpm.
    If you are sure you want Emacs compiled without X window support, pass
      --without-x
    to configure.
    

    I looked in internet about this problem and a reply in a thread says to use:

    sudo apt-get build-dep emacs23
    

    and this will install everything needed to compile emac23 package but when I do this I get :

    E: Unable to find a source package for emacs25.1
    

    In software and updates screen I've enabled the source code option. I checked in etc/apt/sources.list.d folder and it is empty.

    I'm not sure what to do. If everything fails will compiling emacs without x window support cause problems later?

    Should I try to manually install x development files, toolkit files,files for image handling. How is how do I do this.

    Edit:

    So I installed Emacs using pre-built package. used command :

    sudo apt-get install emacs
    

    Edit 2:

    In 2019 I'm now using VIM editor, so can't address this question now. But if you have an answer feel free to leave below

    • steeldriver
      steeldriver over 7 years
      What version of Ubuntu are you using, and are you sure that you really need version 25.1 of emacs? Especially if you are new to Linux, it's recommended to use the pre-built versions of software from the provided repositories wherever possible - Ubuntu 16.04 already has emacs24.5 for example.
    • edwinksl
      edwinksl over 7 years
      See askubuntu.com/q/851633/15003 for how to install Emacs 25.1 from a PPA, which should be easier than installing from source.
    • kanr
      kanr over 7 years
      installed emacs using : sudo apt-get install emacs
  • Kreuzfeld
    Kreuzfeld almost 4 years
    This worked for me, on GalliumOS 3 and emacs 26.3, but only after I also ran
  • alper
    alper about 3 years
    E: Package 'texinfo-doc-nonfree' has no installation candidate