Labs
General information on labs
During a laboratory session, you are not supposed to surf on the Internet, except for searching some information relevant to this laboratory session. Also, you are not supposed to read your email, chat, and send SMS or whatever. Do not work in groups, not even in groups of two. You will get a much better understanding and get the maximum benefit of the lab if working alone. While far less difficult, sitting near a geek and admiring how fast she/he is will not be as beneficial. Of course, You can exchange ideas with somebody else during the lab, but lab reports are individual, personal work. After you have tried hard on a question, you can obvisouly seek for help by calling the teaching assistants. Also, sometimes, a partial solution is given with a(Help me!)
This will give you a partial help
.
The very basics of Software development
- Editing a C file
$ emacs myfile.cYou may also use your favorite text editor.
- Compiling a C file
$ gcc -o myExe myFile.cwith myExe, the name you want to give to the executable file, and myFile.c, the name of the C file you want to compile.
Compilation may fail: in most cases, it is due to an error in your program.
Sometimes, when using perticular programming libraries, you need to specify additional compilation directives. For example, when using POSIX features, you need to specify the real-time library:
$ gcc -lrt -o myExe myFile.cExecuting your program
$ myExe
F.A.Q.
- I am stuck with programming, what should I do?
$ man forkAnd to specify a given section (here, section 2) of manual pages:
$ man -S 2 cloneAnother way to do is to use the apropos command:
$ apropos cloneAlso, you can find information on the course's slides or on Linux manual pages on the Internet.
- When I compile, I get error messages, what should I do?