Linking (The GNU D Compiler)

### 1.6 Options for Linking ¶

These options come into play when the compiler links object files into an executable output file. They are meaningless if the compiler is not doing a link step.

`-defaultlib=libname` ¶

  Specify the library to use instead of libphobos when linking. Options specifying the linkage of libphobos, such as `-static-libphobos` or `-shared-libphobos`, are ignored.

`-debuglib=libname` ¶

  Specify the debug library to use instead of libphobos when linking. This option has no effect unless the `-g` option was also given on the command line. Options specifying the linkage of libphobos, such as `-static-libphobos` or `-shared-libphobos`, are ignored.

`-nophoboslib` ¶

  Do not use the Phobos or D runtime library when linking. Options specifying the linkage of libphobos, such as `-static-libphobos` or `-shared-libphobos`, are ignored. The standard system libraries are used normally, unless `-nostdlib` or `-nodefaultlibs` is used.

`-shared-libphobos` ¶

  On systems that provide `libgphobos` and `libgdruntime` as a shared and a static library, this option forces the use of the shared version. If no shared version was built when the compiler was configured, this option has no effect.

`-static-libphobos` ¶

  On systems that provide `libgphobos` and `libgdruntime` as a shared and a static library, this option forces the use of the static version. If no static version was built when the compiler was configured, this option has no effect.