week6 - Unix C + GNU HTML Perl Python Libraries & Files...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 1 Comp-206 : Introduction to Software Systems Week 6 Joseph Vybihal Computer Science McGill University
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 2 Announcements Midterm exam: In Class Friday, October 23 Final Exam December 18 @ 2PM » TA's Sina – ENGTR 3 rd floor Alex – ENGTR 3 rd floor Mon 10:00-12:00 Mon 13:00-15:00
Background image of page 2
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 3 Announcements Midterm next Friday (in class) Monday will talk about it Contents: Lectures weeks 1 to 6 Assignments #1 and #2 I'll post a sample midterm on WEB CT this weekend.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 4 Midterm Exam In class, 60 mins, 3 questions Topics: C programming (up to Wed's lecture) Exam focus: Programming Secondary topics: Definitions Problem solving
Background image of page 4
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 5 Types of Midterm Questions Write a program in login scripts, general Scripts or/and C. What's wrong with this code? Write the command-line command for. .. Definitions: shell, Unix, Sessions,. .. Scope
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 6 Part 1 C’s Standard Libraries
Background image of page 6
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 7 About Libraries They are made from 2 files: .h .o (originally .c or .assembler file) The .o files are often merged (like a zip) into a single file called a: .lib, or .dll .lib files are merged into your program .dll files are merged into the OS and called/shared by all programs.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 8 Linking .lib Files gcc –c file.c file2.c gcc –o outfile file.o file2.c
Background image of page 8
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 9 GCC and Libraries Two steps to use libraries Step 1: Compiler needs to know about them C's Standard Library the LIB directory This is default (so nothing to do, automatic) Invoking external libaries through GCC Gcc file.c -l library gcc -I/opt/gdbm/include dbmain.c /opt/gdbm/lib/libgdbm.a Step 2: You need to ask to use them #include <standard c library> or #include “path/external c library”
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Unix C + GNU HTML Perl Python COMP 206 - Joseph Vybihal 2007 10 Many Libraries #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <ctype.h> Many more come standard in C Many more designed special for your compiler Many more can be purchased .h simply refers to a “header” file. It is basically the same as a .c file but
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 53

week6 - Unix C + GNU HTML Perl Python Libraries &amp; Files...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online