NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on May 10, 2005, 12:22:24 PM

Title: static library question
Post by: nobody on May 10, 2005, 12:22:24 PM
in MASM, there's includelib.. how do you use static libs in NASM?
Title: Re: static library question
Post by: Frank Kotler on May 10, 2005, 01:11:35 PM
I don't use Masm, so I'm not certain, but I'm pretty sure that Masm itself - the assembler - doesn't use "includelib" at all. Rather, when Masm calls "link" for you - which it does, unless you use the "/c" switch, IIRC - it passes the library name to "link" on the command line.

Since Nasm doesn't call a linker for you (which linker would it call???), there's no equivalent in Nasm - you'll need to add the name of the library to the command line *you* give your linker...

ld -o myfile myfile.o somelib.a
*link myfile.obj somelib.lib

...or whatever. You may need to provide the full path to the library, or - depending on the linker - the "LIB" environment variable may be read to provide a search path for libraries.

In short, libraries are a "linker issue", and "not Nasm's job, maaan." :)

Best,
Frank