如何在 Makefile 中 link 一个特别命名的静态库?
How to link a particularly named static library in Makefile?
我最近使用 Cmake/MinGW 从源代码构建 glfw3 库。在 make install
之后,在 lib 文件夹中,我得到了以下二进制文件:
- glfw3.dll
- glfw3dll.a
现在 link 和 makefile 中的静态库,我将 glfw3dll.a
的名称更改为 libglfw3dll.a
,这样我就可以写 linker 标志 -lglfw3dll
在生成文件中。但这感觉像是一个 hack。有没有办法在不更改名称的情况下做到这一点?
Is there a way to do it without changing the name?
是,通过:
-l:glfw3dll.a
顺便说一句,这是关于 commandline options of GNU ld 的事实。它与 make
或 makefiles 无关。
我最近使用 Cmake/MinGW 从源代码构建 glfw3 库。在 make install
之后,在 lib 文件夹中,我得到了以下二进制文件:
- glfw3.dll
- glfw3dll.a
现在 link 和 makefile 中的静态库,我将 glfw3dll.a
的名称更改为 libglfw3dll.a
,这样我就可以写 linker 标志 -lglfw3dll
在生成文件中。但这感觉像是一个 hack。有没有办法在不更改名称的情况下做到这一点?
Is there a way to do it without changing the name?
是,通过:
-l:glfw3dll.a
顺便说一句,这是关于 commandline options of GNU ld 的事实。它与 make
或 makefiles 无关。