Objectives:
To get to know your tutor and your classmates.
To get familiar with the course page.
To get familiar with Cygwin, vim, and g++.
Go to the course page: personal.cityu.edu.hk/~dcrosela and
browse through this page. List the information you can get from this
page and things missing. The things missing will be added bit by bit. Note that all student notices will be sent to you through e-mail
and also posted on the course page in case you run out of your disk quota or
accidentally delete the message.
Get into the Cygwin: Click the icon Cygwin from the desktop.
Read Configure Cygwin.
Set necessary environment variables for implementation
of SSD5 programs:
Outside Cygwin, find where the cygwin.bat is and take a look on
it. You may change the its contents as described in 3, exit from
Cygwin (type exit, may be twice) and start Cygwin again.
At home, once you change the configuration file cygwin.bat as described
in 3 on your computer, you don't need to take care of the above two
environment variables. However, the lab rooms may not set these
variables correctly for your usage. You may need to change
cygwin.bat everytime before starting Cygwin in lab rooms since they
don't keep your changes. Another way is to the following two steps
inside Cygwin.
Check the values of the current environment variables:
echo $PATH
echo $HOME
Note that PATH and HOME are all capital letters.
Check if the values of
$PATH include your current directory "./" and if $HOME is set to
your working directory. You may need to use the command mount to
know the file name under Windows.
Set the proper values for the environment variables:
export PATH=PATH:./
echo $PATH
myprog.cc and errprog.cc from the
course page.pwd.
cd MyFolderWithPath.
ls [-l] [-a] cat myprog.ccless myprog.ccman [command]Read Introduction to vim and try to use vim to create
and edit a
file.
Read Compile and
execute a simple program. Then compile and execute a simple program:
g++ -o myprog myprog.c
myprog
Compile and run simple programs with arguments.
g++ -o cmdline.cc
a
(Should have error message)
a first second third
g++ word-count.cc
a
(Should have error message)
a word-count.cc
a cmdline.cc
myprog
Compile a program which has errors.
Read the message carefully and try to understand the message. Then
correct the error and make it run.
g++ errprog.c
Note: You may compare this program with myprog.cc in case you cannot
correct it.
See what the preprocess does.
g++ -E myprog.cc > myprog.e1
g++ -DDEBUG -E myprog.cc > myprog.e2
Before you leave the lab room, remember to type exit to
quit the Cygwin.
4 to 1 -- awarded according to the completeness of working the lab exercises.
0 -- absent (without extenuating circumstance) or no participation at all.
Copyright © 2002 Rossella KH Lau
Last modified: August 30, 2002