How does pragma(lib) work?
Walter Bright
newshound2 at digitalmars.com
Sun Aug 28 13:18:30 PDT 2011
On 8/27/2011 8:59 AM, dsimcha wrote:
> When I add the directive:
>
> pragma(lib, "foo");
>
> to a file called "bar.d" and then do:
>
> dmd -c bar.d
>
> does the object file bar.o or bar.obj contain a directive that reflects the
> pragma, or does pragma(lib) only work when compiling and linking in one step,
> e.g. dmd bar.d?
On Windows, it embeds a reference to the library in the .obj file. The .o format
does not support this, so on those platforms it adds "foo.a" to the link command.
More information about the Digitalmars-d
mailing list