A wrote:
Hi,
Can you actually compile header files? I'm writing a header file named
"test.h" using Visual C++ 6.0 and I get the following error message when I
try to compile it:
"no compile tool associated with this file extension".
Anyway, I thought the compiler will just do a syntax check, but it seems it
doesn't like it. Any comments appreciated.
side note: what does precompiled header mean?
Regards,
A
Some compilers allow precompiled headers.
When a compiler "precompiles" a header, it parses the text and
stores the relevant information (definitions & declarations)
in file for later usage. Next time the compiler encounters
the header file, it doesn't need to parse the text again;
it just uses the definitions that it stored away.
The precompilation step is supposed to speed up the
compilation process, especially for large header files
{like those encountered for MS Windows). Although there
is no standard for precompilation, some compilers give
out warnings, such as "Cannot precompile header: code
in header". I encounter this when I declare default values
in constructs. When this happens, is precompilation really
a feature? Hmmm.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library