Headers common to .cpp and .rc files

Tech-Archive recommends: Fix windows errors by optimizing your registry



My .rc files use definitions common to them and the .cpp files.

These definitions are in header files included by both.

However, it is convenient for these headers sometimes also to contain things like structure definitions and inline functions which are irrelevant to the rc files, and may cause problems for the rc compiler.

Now I could insert above the inclusions in the rc file

#define THIS_IS_AN_RC_FILE

and then within the headers put

#if !defined THIS_IS_AN_RC_FILE
// all the stuff I don't want the rc file to see
#endif

but it occurs to me that the rc compiler might automatically define something equivalent.

Does it?

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm

.



Relevant Pages

  • Re: NEED SOME ADVICE HOW TO USE PRECOMPILED HEADERS WHILE AVOIDING ERROR C1010
    ... unexpected end of file while looking for pre-compiled headers. ... "not using precompiled header" for all external files. ... I even noticed that the compiler does not cooperate with headers ... If your cpp files use identifiers like TCHAR then they must include windows headers, ...
    (microsoft.public.vc.language)
  • Re: Using GDI+ in C++
    ... out how to modify library or API headers. ... that purpose, today, the compiler has a few options that ... The reason for it can be seen by looking at the output of: ... the definitions of the symbols mentioned in the complaints. ...
    (microsoft.public.vc.language)
  • Re: precompiled headers question
    ... All my source files are not in the same folder. ... which contains headers and sources of publishing functionality. ... That is because the compiler will look for the PCH instead of trying to load ... extern int MyFunction; ...
    (microsoft.public.dotnet.languages.vc)
  • Re: C and other programming languages
    ... language of choice, otherwise I wouldn't be using it in the first place. ... The main problem is that headers are not ... useless because they are often highly compiler specific. ... So setting the size of a string, ...
    (comp.lang.misc)
  • Re: PROS/CONS: #define BEGIN {
    ... It could cause the compiler to assume that subsequent code ... > detect and report a syntax error, but it could report any number of ... check for syntax errors in the headers. ... gcc usually dies with a parse error. ...
    (comp.lang.c)