Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cygwin Linux for Windows Desktop Paul Stuyvesant.

Similar presentations

Presentation on theme: "Cygwin Linux for Windows Desktop Paul Stuyvesant."— Presentation transcript:

1 Cygwin Linux for Windows Desktop Paul Stuyvesant

2 Introduction Various tools available to work with Linux –Knoppix - boot from CD –Dual Boot PC –Download a full distro from a vendor Cygwin requires no financial investment –No impact on existing system –Free!

3 Introduction Will give developers a ‘heads up’ to Linux Familiarise them with: –File structure –Simple Commands –gcc and g++












15 Icon created on the desktop Linux file structure created on disk Directories holding ‘mirror’ information Click on icon to start Cygwin Using Cygwin

16 Running Cygwin



19 No concept of filetypes in Linux –Can make it confusing initially Developer can use.c and.cpp if they wish It is a good idea to set standards –Enforce the standards company wide Overview

20 List directory contents ls ls -a ls -l ls -la Filenames that being. are ‘hidden’ Each user has ‘home’ directory –Indicated by ~ on display Basic Commands


22 Create a new directory mkdir progs mkdir ~/progs2 Change directory cd progsChange to progs directory cd ~Change to home directory cd /Change to root directory cd ~/progsChange to progs via home Basic Commands


24 Not usually downloaded by default. Go back to Cygwin website and rerun setup. Choose gcc/g++ from the various packages –Can sometimes be difficult to find –Can download both executable and source –Usually some dependencies Installing gcc/g++



27 Standard Linux/Unix tools are terrible emacs vi vim Get hold of a decent text editor My recommendation is Textpad Editing Files

28 Try before you buy Relatively cheap Files saved as either DOS or Unix format Built in macros, or create your own Excellent search facility in the tool Active user community on the net Infinitely customisable Textpad

29 Part of the GNU toolchain Portable compiler that runs on most platforms available Can produce output for many types of processors Can be used as a cross compiler –Generates executable for different system gcc

30 No concept of filetypes in Linux Developer can use.c and.cpp if they wish –It is a good idea to set standards at the outset By default gcc creates an executable file –Called a.out or a.exe –Someone thought it was a good idea –Various options to override default name gcc

31 gcc first.c –Compiles and links first.c –Creates an executable called a.out or a.exe gcc –Wall first.c –Compile/link first.c with common warnings –Recommended you always use this option gcc –Wall first.c –o first –Creates executable called first or first.exe Compile and Link


33 gcc –Wall –c first.c –Create object file called first.o –Does not link or create executable gcc –Wall –c first.c hello.c –Create object file for each source file –first.o and hello.o Compile

34 gcc first.o hello.o –o paulprog –Create executable file called paulprog.exe –Inputs are first.o and hello.o gcc first.o../Paulobj/hello.o –o paulprog –Use object file in different directory –Build program from a variety of object Link

35 User written headers should be in quotes Specify where the header is located –#include “paul.h” Current Dir –#include "Hdrs/paul.h“Specified Dir Can create Paths so directory is not required –C_INCLUDE_PATH=~/C_Progs/Hdrs –export C_INCLUDE_PATH –CPLUS_INCLUDE_PATH=~/CPP_Progs/Hdrs –export CPLUS_INCLUDE_PATH Headers

36 Used to compile C++ code Most parameters the same as gcc Code checking is tighter than gcc –Program compiled OK in gcc may get errors with g++ Nearly all C programs are valid C++ programs –Simply recompile using g++ g++

37 If you want to use Linux read up about –File and Directory Permissions –Aliases –Shell and Environment Variables –Startup files –Pipes –Makefiles Further Topics

38 g++/gcc are part of powerful toolset –Free download, easy to install –Quick and (relatively) easy to work with Large amount of help on www –Sometimes too much Get ahead of the game – try it now Summary

39 THE END Thanks for staying awake Enjoy the rest of the conference A copy of presentation will be available at Any questions drop me a line at


Download ppt "Cygwin Linux for Windows Desktop Paul Stuyvesant."

Similar presentations

Ads by Google