Build or compile

后端 未结 6 987
终归单人心
终归单人心 2020-12-28 18:17

I have a theoretical question about the difference between compile and build. I\'m programming in a c++ project that takes a lot of time to build, so I have told to do build

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-28 18:33

    Compiling is the act of turning source code into object code.

    Linking is the act of combining object code with libraries into a raw executable.

    Building is the sequence composed of compiling and linking, with possibly other tasks such as installer creation.

    taken from What is the difference between compile code and executable code?

    Therefore, you only need to (re-)compile object-code that is older ("has been edited more recently") than the source file to link an executable that contains the newest changes in your program. In fact, this is how make decides whether to build a file.

提交回复
热议问题