--- Debasish Deka <[EMAIL PROTECTED]> wrote: > OK, > But how to use those library files, > Header files we can use by including them with -- > #include > <header-filename.h> > But how to use the library files > Kindly tell > Regards, > Debasish > <html><DIV> > <P><FONT face="Lucida Handwriting, Cursive" > color=#ff9900 > size=2>Karmennavava Dhikaraste, Maaphaleshu > Kadaachanah</FONT></P></DIV></html> > > ----Original Message Follows---- > From: Ray Devore <[EMAIL PROTECTED]> > Reply-To: [email protected] > To: [email protected] > Subject: Re: [c-prog] Creating Header Files (was: > Creating Libraries) > Date: Fri, 29 Dec 2006 12:52:19 -0800 (PST) > > --- Srikanth M R <[EMAIL PROTECTED]> wrote: > > I do have a lot of reference books. But I doubt > if > > any > > contains information about this. > > --- Ray Devore <[EMAIL PROTECTED]> wrote: > > > > > --- Srikanth M R <[EMAIL PROTECTED]> wrote: > > > > Sorry, I didn't know that libraries and > header > > > files > > > > were different. Its creation of header files > > that > > > > I'm > > > > looking for > > > > > > > > --- Ray Devore <[EMAIL PROTECTED]> > wrote: > > > > > > > > > --- Srikanth M R <[EMAIL PROTECTED]> > wrote: > > > > > > Hello everyone. > > > > > > > > > > > > My question is pretty straightforward. > How > > do > > > I > > > > > > create a library(i.e a header file) in > > C/C++? > > > > > > > > > > > > Thanq > > > > > > Bye > > > > > > > > > > > > > > > > First get your terminology straight. A > > library > > > is > > > > > a compiled file usually with a .lib or .dll > > > > extension. > > > > > > > > > > A header file is a code file that usually > > > contains > > > > > declarations of functions (or in C++ a > class > > or > > > > > templates). To create a header file, > create a > > > > code > > > > > file, and save it with a .h extension. > What > > to > > > > put in > > > > > it and how to use it goes further than > giving > > a > > > > > "straightforward" answer. > > > > > > > > > > Ray > > > > > > > > > > > Then you have your answer. Do you have a good > > > reference book? > > > > > > Ray > > > > Srikanth, > > Do a web search on "create C header files" (without > the quotes) and you will get a lot of sites with > examples of how to do this. > > Ray > Actually you should do:
#include "your-header.h" The quotes tell the compiler to look in the current directory first, then the system include directory. The angle brackets <> tell the compiler to look in the system include directory. The use of library files (.lib) depends on your linker. You have to tell your linker what libraries you want to include in your link. Check the documentation for your compiler/linker. The use of dynamic link library (.dll) files depends on your operating system. Ray __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
