Quote:
Originally Posted by
cyberfish
GCC can't (or am I missing something). In the UNIX world they are done by two different programs entirely (compiling and linking, by gcc and ld).
I am uncertain of how GCC works or if it supports this or not. I believe there was some experimental code or something, but nothing in the main executable.
Quote:
It would be truly amazing of the Microsoft compiler if it can do that.
But it can.
Quote:
But is that to say every time a cpp file is changed, the whole project needs to be recompiled? Since that's the only way cross-file inlining can be done?
I cannot say for sure, but usually when compiling a Release, it is a pretty long process and many files are typically re-compiled, and during a Debug build, you do not use optimizations.
But I think the optimization is done at the linker stage, so perhaps only the linking stage needs to be redone.
Quote:
If that is the case... then what's the difference between that and including cpp files? (and keeping dummy header files for human reference, or include all headers before all cpp's?)
For one thing, it is considered bad practice to include source files. Not that it is really such a bad thing if used like this, but anyway.
Secondly, the entire code base is completely re-compiled everytime, even if nothing has changed in those source files.
Thirdly, I guess there will be complications, such as global variables with internal linkage, and such. Probably much more.
Quote:
I thought one of the main advantages of using headers is that the project can be incrementally compiled.
Not sure what you are hinting at?