The pragma(lib)
works best if you compile all the modules together by listing them all on the command line. If you compile them with separate calls to the compiler, the library reference often gets lost (I think the only exception is dmd on Windows).
Are you compiling everything together?