c++ - Why are many object files linked instead of one large object file? -



c++ - Why are many object files linked instead of one large object file? -

why compiled programming languages (c++ example) set create many object files linked opposed one big object beingness created?

for illustration (written in c++, apply compiled language), consider 2 files in project main.cpp , auxiliary.cpp. difference between main.cpp , auxiliary.cpp beingness compiled main.o , auxiliary.o , linked main.exe, , main.cpp #include auxiliary.cpp beingness compiled main.o , linked main.exe? knowledge, these @ to the lowest degree superficially produce same result.

i see necessity multiple objects in case of multi-language projects, not otherwise. multiple objects somehow give linker more flexibility in creating executable?

separate compilation units create compiling faster. if create alter in auxilliary.cpp, compiler needs recreate auxilliary.o rather recompiling everything. becomes of import larger project is.

c++ compiler-construction linker object-files

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -