Cygwin's understanding

Source: Internet
Author: User

The source for compiling QC has encountered many problems over the past few days. Because rvct2.2 is a Windows version, it has to be compiled on a Windows machine. When using cygwind, it has encountered some problems, for more information, see ~~

Cygwin provides a simulated Linux environment on Windows. After installation, cygwin. bat is enabled. In fact, cygwin runs a bash on DOS:

@ Echo off

C:

Chdir C:/cygwin/bin

Bash -- login-I

After adding cgywin/bin to path, you can directly press the bash command in cmd to enter bash. Cygwincan't execute the ELF File under unix, but can only execute the .exe file under windows, and the applications compiled by GCC are also executable programs in windows. Look at the files under cygwin/bin and find that the command * .exeis used in the same way as linux. the bashof cygwincan automatically complete the conversion from lsto ls.exe. Therefore, when cygwin is used, the bash interface actually does not need to be used. You only need to use the bin library provided by cygwin. After adding this bin library to the path, these commands are available in Linux under DOS. In fact, DOS can also be considered as a bash at this time ~~

It's still a long time to figure out what cygwin is... Although it is similar, the cygwin environment is actually a real Unix environment. Although it may not support a general UNIX database, it is indeed a Unix environment, the commands provided by it can achieve the same effect as standard UNIX, except that these commands run on Windows ~~ Therefore, if build_unix = yes is an option, it cannot be removed under cygwin ....

Here we will talk about the-MnO-cygwin option compiled by GCC in cygwin. In this example, the generated .exe does not need to rely on the third-party library cygwin1.dll. All the libraries use the libraries provided by the OS. Because GCC is used by default to compile under cygwin
The translated executable programs depend on cygwin1.dll. To generate an application that does not depend on cygwin1.dll, you can specify this option during compilation. However
After the option, cygwin no longer uses the standard library provided by it by default, but uses the standard library provided by mingw for compilation. If your cygwin does not correctly install the mingw library, it will report
The header file cannot be found. Detailed documentation can be referred here: http://www.delorie.com/howto/cygwin/mno-cygwin-howto.html

However, although cygwin provides common functions in UNIX, sometimes some commands may become faulty. during compilation, YACC always crashes and the solution is simple, it is to copy the corresponding makefile to the standard Linux for compilation, generate the corresponding file, and then copy the file to cygwin for compilation. I think other commands can be solved in this way.

Finally, a trick is to add the bin of cygwin to the path. We can use Bash [parameter] in cmd to enter cygwin and execute the corresponding command, for example, I want to execute *** In the CMD directory ***. CMD, then we first enter this directory and then tap bash. /***. run CMD in cygwin ~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.