Windows上的Cygwin和真正的UNIX环境有什么区别
我是一名 C/C++ 开发人员。我从来没有在 UNIX 上做过 C++ 编程,我只在 Windows 上做过。
我想在 Unix 上练习 C++。 (因为所有大公司都要求在 Unix 上使用 C++)。
我有一台笔记本电脑,我不想在上面安装任何其他操作系统(因为我在上面安装了非常重要的软件并且没有设置)
所以,我搜索并找到了 CygWin,它是 Windows 的 Unix 模拟器。 我正在考虑在这方面练习 C++。
Unix 和 Cygwin 之间有什么区别?
I am a C/C++ developer. I have never done C++ programming on UNIX, I have done only on windows.
I want to practice C++ on Unix. (Because all big companies ask C++ with Unix).
I have a laptop on which I do not want to install any other OS (because I have installed very important software on it and I don't have setups)
So, I searched and found CygWin which is Unix emulator for Windows.
I am thinking to practice C++ on this.
What will be the difference between Unix and Cygwin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能会发现此链接很有帮助:
http://en.wikipedia.org/wiki/Cygwin
他们提供了很多有用的信息帮助您更好地了解将要发生的事情。
我的建议是虚拟化您自己的环境(例如,在 Virtual Box 中使用 Ubuntu)。谷歌搜索以获取下载链接
您可以随心所欲地进行实验。
You may find this link helpful:
http://en.wikipedia.org/wiki/Cygwin
They provide a lot of useful information to help you better understand what will be going on.
My advice would be to virtualize your own environment (with Ubuntu inside Virtual Box for example). Google them to get the download links
You can experiment to your heart's content.
下载 VirtualBox,然后安装您选择的 Unix 版本。就我个人而言,我是 Ubuntu 的忠实粉丝。 :)
虽然 Cygwin 的功能相当出色,但它与直接在 Unix 机器上工作不同。
Download VirtualBox, then install a Unix flavour of your choice. Personally, I'm a big fan of Ubuntu. :)
Though Cygwin is pretty great at what it does, it's not going to be the same as working directly on a Unix machine.
Cygwin 只是具有真实 Unix 操作系统功能的子集,并且有一些关于 Unix 操作系统您需要了解的事情,而 cygwin 不会告诉您。
这取决于您需要能够在 UNIX 机器上执行什么操作。因为它有不同的文件系统,并且没有与 Windows 相同的目录结构。例如,Unix 中没有“程序文件”,您可能需要知道很多文件所在的位置,而使用 cygwin 则无法找到这些信息。
虽然我同意,但如果您不想在计算机上安装另一个操作系统,您可以将其安装在虚拟机中,或者只是偶尔使用它,您可以简单地使用 liveCD
Cygwin just has a subset of the functionality of a real Unix OS and there are certain things which you need to know about the Unix OS that cygwin will not tell you.
It depends what you need to be able to do on a unix machine. As it has a different file system and doesn't have the same directory structure as Windows. For example there isn't a 'Program Files' in Unix, and you may need to know where a lot of files are situated, which you will not find out with cygwin.
Though I do agree, if you don't want to install another OS on your machine, you can install it in a Virtual machine, or to simply use it every now and then you could simply use a liveCD
Cygwin 主要是一个 POSIX 模拟器 - 其中 POSIX 是 UNIX 和其他系统的一些最低公分母。这使得在 Windows 上运行干净编写的 POSIX 应用程序成为可能。
您还将在 cygwin 中找到 POSIX 中指定的所有内容(例如文件系统层次结构、/proc 文件系统、信号、套接字),并且它将在 POSIX 规范内运行。但由于 POSIX 中很多东西都没有指定,它不会 100% 像任何其他真正的 Unix 系统。
例如,在大多数 UNIX 系统上,您可以在文件打开时将其删除(这将使其成为一个没有名称的临时文件,当最后一个用户关闭它时,该文件将被删除)。 Windows 不允许这样做(POSIX 也不强制这样做);所以在 Cygwin 上您将拥有 Windows 文件语义(您无法在文件打开时删除它)。
文件名中允许的字符、文件名区分大小写以及(当然)大多数真实 UNIX 提供但未包含在 Cygwin 中的所有附加 API(POSIX 除外)也是如此。
(至少你可以在 Cygwin 中拥有一个 X 服务器,它同样只支持基本的 X 操作)。
Cygwin is mainly a POSIX emulator - where POSIX is some lowest common denominator of UNIX and other systems. This makes it possible to have cleanly written POSIX applications running on Windows.
You will find all things that are specified in POSIX (like the filesystem hierarchy, /proc filesystem, signals, sockets) in cygwin as well and it will behave within the POSIX specs. But as lots of things are unspecified in POSIX, it will not be 100% like any other real Unix system.
For example, on most UNIX systems, you can delete a file while it is open (which will make it a temporary file without name which will be deleted when the last user closes it). Windows does not allow this (and POSIX does not mandate it either); so on Cygwin you will have Windows file semantics (you cannot delete a file while it is open).
Same goes for allowed characters in filenames, filename case sensitivity, and (of course) all the additional APIs (besids POSIX) that most real UNIXes offer but which are not included in Cygwin.
(At least you can have a X server in Cygwin, which does again only support the basic X operations).