Sunday, April 13, 2014

Cygwin: Using Linux in Window


Cygwin: Get that Linux feeling - on Windows

Cygwin is:
  • 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.
http://cygwin.com/

To install the new package: Run setup.exe again and select the desired package, tick on "Src?" square
Select “Install from Internet”

cygpath                Convert Unix and Windows format paths, or output system path information 
cygcheck             List system information, check installed packages, or query package database.
cygcheck -l test    list all file contain "test"
cygcheck -c  \      Check package and version number
dumper                Dump core from WIN32PID to FILENAME.core
getconf                Get configuration values


C/C++, Fortran, compiler with cygwin
- "gcc", "gdb", and "make" in the search separately to find the package, select the desired package
- it usually locates at "Devel" (development)
- $ g++ -v      : after instaled, go to cygwin terminal  to check whether gcc was installed
- $ cygcheck -c bash binutils bzip2 cygwin gcc-core gcc-g++ gcc-java gzip  m4 make unzip zip
                        check the package need for gcc
cygcheck -c  \
$ g++ --version   check g++ version   
$ gcc --version   check  gcc version 
- $ gcc -c program.c -o program      try to compile a file



ERRORS and problems solving
- vi/ vim error in Cygwin: error with backspace, arrow,  type "vim" in select packages> Search. Then select package: "vim", "gvim", "vim-common", "vim-minimal", "vim-debuginfo"
cp /usr/share/vim/vim7/vimrc_example.vim  ~/.vimrc
$ vim file.txt    use vim instead of vi, or u can make a short cut in .bashrc

No comments:

Post a Comment