Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您能否解释一下,如何使用 -l 选项与 .la 文件进行链接?
据我的经验 - 我只链接到静态库(.a)文件。
现在我查看了一些 Qt 生成的 Makefiles 并且无法弄清楚,当指定 -l QtCore 开关而不是寻找 libQtCore.a 时,链接器如何计算出使用/打开 libQtCore.la 文件。
此外 - gcc 手册指出,-l[library name] 开关将包括 lib[library name].a,而不是 lib[libraryname].la。
.la据我所知,文件是 libtool 垃圾,不应手动链接。无论出于何种原因需要它们,它们都由 libtool 在内部使用。您应该链接到该*.a文件。在 Qt 安装/构建中应该有*.a要链接的文件。
.la
*.a