为什么C ++静态库项目没有链接器设置? [英] Why doesn't a C++ static library project have linker settings?

查看:639
本文介绍了为什么C ++静态库项目没有链接器设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表明我的无知:为什么静态库项目(在我的情况下为Visual Studio)在项目属性页中没有链接器设置?我以为链接"在很大程度上是关于库的,但是显然我从根本上误解了某些东西.

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 of a big deal re: libraries, but apparently I fundamentally misunderstand something.

推荐答案

制作可执行文件的过程分为三个步骤:

Making an executable is a three step process:

  1. 编译器将源代码转换为 对象文件.
  2. 安 存档者/图书管理员将对象分组 文件一起放入库(此 步骤是可选的.)
  3. 链接器链接 将目标文件和库一起创建 完整的可执行文件.
  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.

这篇关于为什么C ++静态库项目没有链接器设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆