Friday, July 9, 2010

Installing and building your C++ programs in Cygwin on Windows Vista

Installation:
  1. Run or download setup.exe from this link: http://www.cygwin.com/setup.exe.
  2. Select "Install from Internet" & "Direct Connection" if that's your Internet setting.
  3. Keep the recommended Root Directory and "Install for" if you don't feel like changing them.
  4. Select your Internet connection
  5. On Select Packages window, Open "Devel" to select gdb & open "Editor" to select vim if you want vi (I know, I'm old-fashioned...)
On Windows Vista, browse to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin" directory, press right mouse button on Cygwin Bash Shell file, selection Properties->Advanced. Check "Run as administrator"

Run Cygwin Bash Shell from Programs list.


Building your first C++ program
$ g++ yourprog.cpp

If you see the following error:
“This application has requested the Runtime to terminate it in an unusual way”

Add the following:
export TEMP=/tmp to your ~/.bashrc file

Close and restart your Cygwin Bash Shell.

No comments: