3 ms·
> If you include header X then you must also link to the library target that X belongs to Visual Studio's solution: #pragma lib(foo). That's that problem solve
by pjc50 8y ago
> If you include header X then you must also link to the library target that X belongs to
Visual Studio's solution: #pragma lib(foo). That's that problem solved. This is not the big problem.
The big problems are a mix of 3 entangled problems:
- textual substitution by macros with cross-file scope: the behaviour of an included file depends entirely on previous files.
- object memory layout and API are unnecessarily bound together, so you can't change so much as a single function argument without completely recompiling all dependent code.
- a number of things (mostly templates but some strings) are duplicated hugely beacause they're defined in the headers, and then de-duplicated at link time. So compilation ends up disk-bound while the compiler writes out lots of data that will be thrown away.
So, you can change one byte in a header high up the dependency chain and recompile most of your code. Slowly.
- JoshTriplett 8y ago> Visual Studio's solution: #pragma lib(foo). That's that problem solved. Not even close to that easy; platform differences make it a pain to find libraries consistently. (Windows tends to make it most difficult, with Apple close behind for a few libraries.)
- pjc50 8y agoYeah, that gets specified "outside the language" in the compiler arguments for link path and include path.
- wnoise 8y ago> - object memory layout and API are unnecessarily bound together, so you can't change so much as a single function argument without completely recompiling all dependent code. These can readily be put in different headers. People often don't, but...