If you are using VS GUI, please remember to add the include dir and the link libraries(e.g. c10.lib, torch.lib and etc.). Also, since the link between caffe2 and caffe2_gpu is broken, please write LoadLibrary('caffe2_gpu.dll'); as the first line of the main function.