makefile 中的LDFLAGS
(2013-12-04 11:12:22)
标签:
it |
分类: Linux |
makefile 中link 动态或者静态库的方法如下:
LDFLAGS= -L<</SPAN>Directory where the library resides> -l<</SPAN>library name>
注意点:
Make sure that the -L -l -L -lname libmine.a libmine.so .dylib .sl).
Conventionally, a static library will be in a file libmine.a.
This is convention, not mandatory, but if the name is not in
the libmine.a -lmine
The -L./libmine libmine
-
You have such a sub-directory containing
libmine.a, in which case you also need to add-lmineto the linker line (after the object files that reference the library). -
You have a file
libminethat is a static archive, in which case you simply list it as a file ./libminewith no-Lin front. Aga -
You have a file
libmine.ain the current directory that you want to pick up. You can either write ./libmine.aor -L . -lmineand both should find the library.

加载中…