473,326 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

C++: compiling header files

A
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
Jul 19 '05 #1
2 7450
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

Jul 19 '05 #2
On Tue, 28 Oct 2003 22:31:06 +1030, "A" <A@iprimus.com.au> wrote in
comp.lang.c++:
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


The reason that you can't compile a file named "test.h" with your
particular compiler has to do with the setup and features of your
particular compiler's IDE. There is nothing in the language that
prevents this, although of course your header might not be a complete,
valid translation unit on it's own.

Either ask in one of Microsoft's support groups on
msnews.microsoft.com to find out how to set your IDE to compile files
like this, or try from a command prompt and use the command line
compiler.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
0
by: tyousaf | last post by:
Hi i am new to mysql and mysql++, i have installed mysql server, it is running fine. i also installed "mysql++-1.7.9gcc3.2-2.i386.rpm" (i have gcc 3.3) , first of all as the readme file says to do...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
2
by: Erik | last post by:
Hi Everyone, I'm having real problems compiling some source for eVC4++. The errors I am getting are below: It all seems to be centred around winsock. If I move the afsock.h reference to before...
18
by: Al | last post by:
I'm still trying to do this but it never worked! In a .cpp file, I write the code, and at the beginning, I write: #ifndef MYLIST_H #define MYLIST_H ....to end: #endif What's wrong with it for...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
6
by: Gaijinco | last post by:
I'm having a weird error compiling a multiple file project: I have three files: tortuga.h where I have declared 5 global variables and prototypes for some functions. tortuga.cpp where I...
1
by: jeet232 | last post by:
I'm using KDevelop 3.3, I've created a new project in c++ as standard hello world program. Then I placed my c++ source files (>30 files), in "src" dir of project. Now problem is that my sources...
1
by: jon2211 | last post by:
I tried to compile some code with #include <shellapi.h. I am linking shell32.lib. I am not trying to use ShellExecute() but right now just getting the code to compile with the header file an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.