From: "chipvick" References: <37F065E4 DOT 2C3B57D5 AT virtualis DOT com> <7sqp95$mus$1 AT solomon DOT cs DOT rose-hulman DOT edu> Subject: Re: Newbie Question Date: Wed, 29 Sep 1999 01:10:52 -0400 Lines: 53 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Newsgroups: comp.lang.c,comp.os.msdos.djgpp To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I just had a he** of a time doing the same thing. For some good info read the FAQ and also the answers to my post dated 9/27 at 10:56 pm. The most important thing is to make sure you know how to use your compiler!! It is very different from one to the next, I use Borland if you need help just email (as it's off topic here). In general though, you'll need 3 files one header.h that has just the struct defs, function prototypes (with a semicolon on the end) and any macros you want to put in there. the 2nd file will be header.c this file will #include the header.h file (in quotes " ", not < >) you just created and it will contain all of the code for the functions in the .h file. Compile the header.c file. The third file you need is yur actual program that will create your .exe file. in this file be sure to #include the .h file. Compile it and enjoy - hopefully. Like I said a lot of it is compiler dependent how you set up your project and structure the nodes that you add to it . Good luck Dave Damian Yerrick wrote in message news:7sqp95$mus$1 AT solomon DOT cs DOT rose-hulman DOT edu... > Alex Mendes da Costa wrote in message > news:37F065E4 DOT 2C3B57D5 AT virtualis DOT com... > > Hi All. > > I know a bit about C programming (i.e. the basics) and wrote a list of C > > routines that I want to be able to save seperately and then use them in > > other programs I write. I don't know how to write a header file or > > invoke the routines with it. Please Help!! > > To write a header file, move all the structs, typedefs, etc. into a new > file named foo.h instead of foo.c. Then copy the first line of each > function (the prototype) into foo.h and place a semicolon > > /* in foo.c */ > void Foo(int bar) > { > ritalin == easy; > ritalin == good; > } /* Foo Fighters joke */ > > /* in foo.h */ > void Foo(int bar); > > If you define any global variables, make them extern in your > header file. > > For more info, ask comp.lang.c > To see an example, get the DOSArena source from the link below. > > Damian Yerrick > http://come.to/yerrick > >