A pragma(lib, "x") putted in a module that isn't not directly use by the client application doesn't make the dependency linked into the generated static library. The work around is to report the pragma(lib, "x") declaration in the main.d module. PS: I also think that the documentation on pragma(lib, "x") miss to explain the format that "x" must have on each platform. I am always confuse on the necessity to have the extension or not, and the "lib" prefix on linux.
*** This issue has been marked as a duplicate of issue 2776 ***