Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 917
Jedaias Rodrigues Avatar asked Apr 10 '15 18:04

Jedaias Rodrigues


2 Answers

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.

like image 83
matrixanomaly Avatar answered Oct 12 '22 21:10

matrixanomaly


build-essential is an abstract package, short for its dependencies:

  • dpkg-dev
    • binutils
    • bzip2
    • libdpkg-perl
    • make
    • patch
    • perl
    • tar
    • xz-utils
  • g++
  • gcc
  • libc6-dev
  • make

So in Cygwin, it is the same to install their substitutes:

apt-cyg install make gcc-core gcc-g++ patch bzip2 perl tar xz

make and gcc-g++ (g++), which depends on gcc-core (gcc), are the most important.

If you really want to compile various projects in Cygwin, packages below may be also helpful. Be careful, libboost-devel is very large.

apt-cyg install git automake cmake python3-devel libboost-devel
like image 23
Yan QiDong Avatar answered Oct 12 '22 22:10

Yan QiDong