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

前端 未结 3 872
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:40

    Because you don't link it, pure and simple.

    Linking is the act of pulling together all your object files and libraries to create an executable. In a static library project you're not making an executable, you're just creating a library which will later be linked.

    For example (and this is UNIX rather than Windows, but the concepts are similar), you would use the compiler cc to turn your source files into object files and the archiver ar to turn those into a library. The linker (or linkage editor) ld does not need to take part until you wanted to go to the next step and include your library into an executable.

提交回复
热议问题