Cygwin - PowerPoint PPT Presentation

About This Presentation
Title:

Cygwin

Description:

Title: No Slide Title Author: Paul Stuyvesant Last modified by: Paul Stuyvesant Created Date: 10/24/2001 6:28:21 PM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 41
Provided by: PaulStu7
Category:
Tags: cygwin | emacs

less

Transcript and Presenter's Notes

Title: Cygwin


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

4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
(No Transcript)
9
(No Transcript)
10
(No Transcript)
11
(No Transcript)
12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
Using Cygwin
  • Icon created on the desktop
  • Linux file structure created on disk
  • Directories holding mirror information
  • Click on icon to start Cygwin

16
Running Cygwin
17
(No Transcript)
18
(No Transcript)
19
Overview
  • 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

20
Basic Commands
  • List directory contentsls ls -a ls -l ls
    -la
  • Filenames that being . are hidden
  • Each user has home directory
  • Indicated by on display

21
(No Transcript)
22
Basic Commands
  • Create a new directorymkdir progsmkdir /progs2
  • Change directory cd progs Change to progs
    directorycd Change to home directory cd
    / Change to root directory cd /progs Change to
    progs via home

23
(No Transcript)
24
Installing gcc/g
  • 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

25
(No Transcript)
26
(No Transcript)
27
Editing Files
  • Standard Linux/Unix tools are terribleemacsvivi
    m
  • Get hold of a decent text editor
  • My recommendation is Textpad

28
Textpad
  • 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

29
gcc
  • 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

30
gcc
  • 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

31
Compile and Link
  • 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

32
(No Transcript)
33
Compile
  • 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

34
Link
  • 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

35
Headers
  • 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

36
g
  • 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

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

38
Summary
  • 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

39
THE END
  • Thanks for staying awake
  • Enjoy the rest of the conference
  • A copy of presentation will be available at
  • www.pcs-training.co.uk/downloads.htm
  • Any questions drop me a line at
  • paul_at_pcs-training.co.uk

40
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com