Jan10 - . . = squared(…); . = squareroot(…); } g++...

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

View Full Document Right Arrow Icon
Jan10 – ECE106 Separate Compilation Squared.h #ifndef SQUARED_H #define SQUARED_H Int squared(int); #endif Squareroot.h #ifndef SQUAREROOT_H #define SQUAREROOT_H Float squareroot(int); #endif Squared.cc #include “squared.h” Int squared(int x){ Return (x*x); } Squareroot.cc #include “squareroot.h” Float squareroot(int x){ Return(sqrt(x)); } Main.cc #include <iosteram> #inlude <cmath> #include “squared.h” #include “squareroot.h” Int main(){
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: . . = squared(…); . = squareroot(…); } g++ main.cc squared.cc squareroot.cc –o main.exe %g++ -c main.cc // generates main.o %g++ -c squared.cc // squared.o %g++ -c squareroot.cc // squareroot.o %g++ main.o squared.o squareroot.o –o main.exe // link Make 1. YOU figure out all possible commands in response to changes 2. YOU express this in a file => Makefile 3. YOU make...
View Full Document

This note was uploaded on 04/17/2008 for the course ECE ECE106 taught by Professor Abdelrahman during the Spring '08 term at University of Toronto- Toronto.

Page1 / 2

Jan10 - . . = squared(…); . = squareroot(…); } g++...

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

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