Path: utzoo!attcan!uunet!munnari!jkjl From: jkjl@munnari.oz (John Lim) Newsgroups: comp.sys.mac.programmer Subject: Re: Make question (was MPW vs Lightspeed) Message-ID: <2653@munnari.oz> Date: 26 Jan 89 01:45:54 GMT References: <322@s1.sys.uea.ac.uk> <24218@apple.Apple.COM> <334@s1.sys.uea.ac.uk> <7260@csli.STANFORD.EDU> Reply-To: jkjl@munnari.UUCP (John Lim) Organization: Comp Sci, Melbourne Uni, Australia Lines: 56 Dear Nathan, The answer to your first question as to why you need to recompile dependant files also is simple. Let's say you have a file : =========================================== main.c ------ #include "dumbo.h" main() { read_Dumbo_record_from_file(&dumbo,"elephant_record.file"); printf("Dumbo's age is %d\n",dumbo.age); } =========================================== and dumbo.h contains : =========================================== dumbo.h ------- struct elephant { int size,age,height; } dumbo; ============================================ As you can see main.c depends on dumbo.h. (I hope you can read C). Now if you change dumbo.h to : ============================================ dumbo.h ------- struct elephant { char name[32]; int size,age,height; } dumbo; ============================================ Now main.c, using the old dumbo.h assumes that dumbo.age is the second field of struct elephant. But if main.c uses the new definition of dumbo, then it's the third field as the offsets have changed. Now if you didnt recompile main.c, the actual program, when trying to read dumbo.age would be extracting the data from the dumbo.name field ! Hope this example helps clarify matters. john