Search code examples
linuxwindowscygwin

How to install `build-essential` in `Cygwin`?


How to install build-essential in Cygwin?
I've tried using: apt-cyg install build-essential But does not work.

Installing build-essential
Package build-essential not found or ambiguous name, exiting

I'm also having problems like:

(gedit: 13864): Gtk-WARNING **: can not open display:


So I can not install crunch. See It:

$ make all
Building binary...
/usr/bin/gcc -pthread -Wall -pedantic -std=c99 undefined crunch.c -lm -o crunch
gcc: error: undefined: No such file or directory
Makefile:48: recipe for target 'crunch' failed
make: *** [crunch] Error 1

What's the problem here, and how can I fix it?


Solution

  • There isn't a build-essential package in Cygwin.

    Build-essential is a collection of packages. So you'll have to select the packages manually, which I believe are the following:

    1. make
    2. automake
    3. gcc
    4. gcc-c++

    Assuming you're doing development, you'll want to select those packages from the Devel branch. This is done when you first install Cygwin and the installer asks you to select the packages, after choosing the download site from the list.

    Screenshot

    As for the Gtk-WARNING **: can not open display: error, this is because your system is not running Cygwin's X11 display server, which provides a surface for graphical applications to render to. Check out http://x.cygwin.com/.

    If you want to run gedit in Windows, you should get the binary for windows here. That's built for Windows and doesn't need Cygwin.

    EDIT: Running sudo apt-get install build-essential on Elementary OS Freya mentions the following dependencies will be installed as well, so you'll probably want that for a 'closer-to-Linux' build environment as well.

    The following extra packages will be installed:

    • g++
    • g++-4.8
    • libstdc++-4.8-dev

    Suggested packages:

    • g++-multilib
    • g++-4.8-multilib
    • gcc-4.8-doc
    • libstdc++6-4.8-dbg
    • libstdc++-4.8-doc

    The following NEW packages will be installed:

    • build-essential
    • g++
    • g++-4.8
    • libstdc++-4.8-dev

    The list of files installed can be found here and the contents of the file list (current as of 4/24/2014) can be found in this PasteBin I made.