When I try to link my C++ app against torch.lib etc., I get a lot of unresolved symbols like exports would be missing from the lib. I  can , however, successfully link against the libs from the official libtorch binaries, so I was wondering how these libs are built.

Our nightly build scripts could be found here 18. If you are using the static libs, linking against torch.lib is not enough. Please link to all the libs under the lib directory except those for the tests. The official libtorch libs are shared libraries, so if you link against torch only, it’s acceptable.

For some reason, torch.dll that gets created does not depend on caffe2_gpu.dll despite compiling with cuda and cudnn (observed using Dependancy walker).

Yes, this is a bug. And I’m fixing it with this PR: https://github.com/pytorch/pytorch/pull/16071 7.