Why doesn't a C++ static library project have linker settings?

前端 未结 3 878
Happy的楠姐
Happy的楠姐 2021-02-20 03:13

Revealing my ignorance: Why doesn\'t a static library project (in Visual Studio in my case) have linker settings in the project properties page? I thought \"linking\" was kind

3条回答
  •  离开以前
    2021-02-20 03:30

    Making an executable is a three step process:

    1. A compiler transforms source code in to object files.
    2. An archiver/librarian groups the object files together into libraries (this step is optional).
    3. A linker links the object files and libraries together to create a complete executable.

    A library is just a collection of objects, which by definition have not been linked yet. The linker is not used to create the library, so it makes sense that there would be no linker options for it.

提交回复
热议问题