Cygwin: Введение
Эта статья будет полезна начинающим пользователям Cygwin. Начнем с того, что нам для начала нужно ответить на простой вопрос. Что же такое Cygwin? Cygwin — это UNIX-подобная среда и интерфейс командной строки для Microsoft Windows. В системе Microsoft Windows уже существует подобный интерфейс cmd. Вызвать командную строку можно сочетанием клавиш Win+R. Но зачастую большую часть работы Windows пользователям приходится делать вручную. По другую сторону Linux пользователь уже давно написал bash-скрипт и сидит пьет пиво в сторонке от автоматизированного рабочего процесса.
Так что же мешает сделать это и в ОС Windows? Правильно, абсолютно ничего не мешает. Но для этого нужны дополнительные программы и библиотеки. Программа Cygwin расширяет возможности стандартной командной строки Windows, позволяя автоматизировать некоторые процессы и разрабатывать программы для Linux и других систем.
Выбираем нужную версию, скачиваем и запускаем исполнительный файл setup-x86.exe и setup-x86_64.exe соответственно.
Окно установки 64 битной версии программы
Окно выбор способа установки
Окно выбора пакетов
Окно установки 32 битной версии программы выглядит точно так же как и 64 битной. Следующим шагом будет окно выбора. Откуда устанавливать или скачивать программу. Всего есть три варианта. Первый вариант Install from Internet (downloaded files will be kept for future re-use) установка из интернета причем загруженные файлы будут храниться до следующего повторного использования. Второй вариант Download Without Installing скачать без установки. Третий вариант Install from Local Directory установка из локального каталога. Т.к. у нас нет локальной копии и нам нужно установить то выбираем первый вариант. Следующее окно будет выбор пути установки. Рекомендую выбрать системный диск, к примеру у меня путь установки Cygwin это C:\cygwin64. Следующее окно это выбор пути где будут храниться временный файлы которые будут скачиваться в процессе установки. У меня это C:\cygwin64\package. Потом нужно выбрать как скачивать через прокси или напрямую. Следующим шагом будет выбор репозитория скачки выбираем любой попавшийся или тот что по умолчанию и жмем Далее. После нажатия кнопки далее начнется процесс скачивания основных конфигов. Следом вы сможете выбрать что устанавливать. Чтобы выбрать пакет нужно нажать Skip около названия пакета. Список пакетов которые вам пригодятся:
- gcc-core (в разделе Devel)
- gcc-g++ (в разделе Devel)
- make (в разделе Devel)
- cmake (в разделе Devel)
- automake (в разделе Devel)
- wget (в разделе Web)
- libiconv (в разделах Devel и Libs)
- openssh (в разделе Net)
- nano (в разделе Editors)
- bash (из раздела Base)
- base-cygwin (из раздела Base)
- base-files (из раздела Base)
- cygwin (из раздела Base)
- file (из раздела Base)
- gzip (из раздела Base)
- login (из раздела Base)
- mintty (из раздела Base)
- openssl (из раздела Base)
- run (из раздела Base)
- tar (из раздела Base)
- vim-minimal (из раздела Base)
- cron (из раздела Admin)
- shutdown (из раздела Admin)
- git (все пакеты из раздела Devel)
Также рекомендую полностью установить раздел Perl и Python. После этого жмем далее и произойдет установка нужных пакетов и их зависимостей. После конца установки можно будет запустить сам Cygwin и начать работу.
Мне не симпатизировал ни цвет фона, ни встроенный шрифт и цвет текста поэтому я кастомизировал его. На этих словах я закончу эту статью.
Данная статья не подлежит комментированию, поскольку её автор ещё не является полноправным участником сообщества. Вы сможете связаться с автором только после того, как он получит приглашение от кого-либо из участников сообщества. До этого момента его username будет скрыт псевдонимом.
Windows: установка Cygwin — GCC + make + gbd
Качаем файл http://cygwin.com/setup-x86_64.exe.
Выбираем Install from Internet:
Выбираем директорию для установки:
Выбираем директорию для установочных файлов:
Настраиваем подключение к сети:
Выбираем зеркало для загрузки:
Находим gcc-core для Win64 : и кликаем на Skip, что бы выбрать версию для установки (первой будет показана последня актуальная версия)
Находим GNU Make:
Находим GDB дебаггер:
Начинается загрузка и установка:
Заускаем Cygwin64 Terminal:
make with Cygwin
I am trying to set VTK on windows (did I say it was complicated?^^). I have successfully configured VTK with CMake and I am now trying to run make through cygwin. However when I go to the build directory and enter make all the terminal prints and does is:
Microsoft Windows [version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
Does anyone know what’s wrong?
EDIT: when typing cygcheck I get:
EDIT 2: Here is a screenshot of what I get (sorry it’s in french)
Thanks in advance for any help you can give 🙂
EDIT 3: New screenshot + Makefile Content
1 Answer 1
The default installation of Cygwin is quite minimal. It doesn’t include GNU make , so you’re getting Microsoft’s make .
You need to re-run Cygwin’s setup-*.exe and add make . Chances are, you probably need other things, too. I suggest opening the Devel category and giving the contents a scan while you’re in there.
EDIT, after screenshots were added to the question:
Your screenshots show several confusions. I’ll go through them one by one, quoting the text in each case:
Pas de cible spécifiée et aucun makefile n’a été trouvé
In English, that is «No targets specified and no makefile found.» This tells you that GNU make is installed and running, but that you don’t have a file called GNUmakefile , makefile , or Makefile in the current directory. It searches for those three, in order.
This is not surprising since ls shows that you are running it in an empty directory.
/cygdrive/c/MinGW/bin/make
There are two problems here:
As I said in the comments, only programs linked to cygwin1.dll can make sense of /cygdrive . Windows’ cmd.exe has no idea what /cygdrive means. c:\MinGW\bin\make is the correct form under cmd.exe .
MinGW is not Cygwin. Any problems you have with MinGW are an entirely separate question, not related to the problems you’re having with Cygwin’s GNU make package.
How to install and use “make” in Windows?
I’m following the instructions of someone whose repository I cloned to my machine. What I want is simple: to be able to use the make command as part of setting up the code environment. But I’m using Windows, and I searched online only to find a make.exe file to download, a make-4.1.tar.gz file to download (I don’t know what to do with it next), and things about downloading MinGW (for GNU; but after installing it I didn’t find any mention of «make»).
I don’t want a GNU compiler or related stuff; I only want to use «make» in Windows. Please tell me what I should do to accomplish that.
Thanks in advance!
10 Answers 10
make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:
The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you’ll have a Linux distribution of your choice embedded in Windows 10 where you’ll be able to install make , gcc and all the tools you need to build C programs.
For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.
An outdated alternative was MinGw, but the project seems to be abandoned so it’s better to go for one of the previous choices.
Cygwin
Get that Linux feeling — on Windows
This is the home of the Cygwin project
. is it?
- a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
- a DLL (cygwin1.dll) which provides substantial POSIX API functionality.
. isn’t it?
- a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
- a way to magically make native Windows apps aware of UNIX® functionality like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.
The Cygwin DLL currently works with all recent, commercially released x86_64 versions of Windows, starting with Windows Vista. For more information see the FAQ.
Cygwin version
The most recent version of the Cygwin DLL is 3.2.0.
Installing Cygwin
Use the setup program to perform a fresh install or to update an existing installation.
Keep in mind that individual packages in the distribution are updated separately from the DLL so the Cygwin DLL version is not useful as a general Cygwin distribution release number.
Support for Cygwin
For all Cygwin-related questions and observations, please check the resources available at this site, such as the FAQ, the User’s Guide and the mailing list archives. If you’ve exhausted these resources then please send email to an appropriate mailing list. This includes observations about web pages, setup questions, questions about where to find things, questions about why things are done a certain way, questions about the color preferences of Cygwin developers, questions about the meaning of the number 42, etc.
Please send notification of technical problems (bad html, broken links) concerning these web pages to the Cygwin mailing list.
Please do not send personal email with «quick questions» to individual Cygwin contributors. The Cygwin mailing lists are the places for all questions. Really. I mean it.
32 bit Cygwin
Address space is a very limiting factor for Cygwin. These days, a full 32 bit Cygwin distro is not feasible anymore, and will in all likelihood fail in random places due to an issue with the fork(2) system call.
Therefore we recommend using 32 bit Cygwin only in limited scenarios, with only a minimum of necessary packages installed, and only if there’s no way to run 64 bit Cygwin instead.
You have been warned. If you’re still sure you really need a 32 bit Cygwin, and there’s absolutely no way around it, you may run the setup-x86.exe installer.
The Cygwin DLL and utilities are Copyright © Cygwin authors. Other packages have other copyrights.
UNIX ® is a registered trademark of the Open Group in the United States and other countries.