0

Beforehand I know how to define a macro in a file like header file by using #define directive but I want to know, regarding Visual C++ compiler, is there any kind of file which is specifically used to hold a macro so that we can use it anywhere in our code we need by some directive which takes name of that file as input?

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Garrett2011
0

Are you talking about precompiled header files? Both Microsoft's VC++ 2010 (and earlier versions too) and g++ support that (other compilers might too, I don't know). You have to create a header file that includes other header files as well as function prototypes, constants, classes, structures and externs. Then you just have to include that header file in each of the *.cpp files. It makes compiling large projects a lot faster because the compiler will not process all those header files for each *.cpp file.

Edited by Ancient Dragon: n/a

0

No. Each unit has it's own #include. Only the project cpp has #includes of all units.

Irrelevant to what I meant.

0

Are you talking about precompiled header files? Both Microsoft's VC++ 2010 (and earlier versions too) and g++ support that (other compilers might too, I don't know). You have to create a header file that includes other header files as well as function prototypes, constants, classes, structures and externs. Then you just have to include that header file in each of the *.cpp files. It makes compiling large projects a lot faster because the compiler will not process all those header files for each *.cpp file.

No I didn't mean that at all.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.