Understanding C++ compilers from a Java / C# perspective

后端 未结 4 2015
有刺的猬
有刺的猬 2021-02-06 14:29

I\'m a moderately experienced Java / C# programmer, and I\'ve recently started learning C++. The problem is, I\'m having trouble understanding how to structure the various heade

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-06 14:31

    you might want to know why compilation and linking are seperate as well (since i dont see any posts explaining it, and it is the cause of a lot of confusion not knowing the underlying reasons of things).

    Linking and compiling is completed seperately because (and there might be more than one reason) of the need to do library calls. if you defined or any of its ilk, the code implementing the function prototypes in those headers are part of the libary that is already compiled and sitting as object code somewhere. if a giant compilation process were to be used instead, you'd need to have the source for those library calls, as well as more time during compile because you'd be also compiling the library code.

提交回复
热议问题