I have build the libs of pytorch statically for windows when I link to my project I get the follow error.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol “__declspec(dllimport) public: __cdecl c10::ivalue::Future::FutureError::FutureError(struct c10::ivalue::Future::FutureError &&)” (_imp??0FutureError@Future@ivalue@c10@@QEAA@$$QEAU0123@@Z) referenced in function “public: class c10::optional & __cdecl c10::optional::operator=(struct c10::ivalue::Future::FutureError &&)” (??$?4UFutureError@Future@ivalue@c10@@@?$optional@UFutureError@Future@ivalue@c10@@@c10@@QEAAAEAV01@$$QEAUFutureError@Future@ivalue@1@@Z)	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\test_pytorch	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\example-app-debug.cpp.obj	1


Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol “__declspec(dllimport) public: struct c10::StrongTypePtr & __cdecl c10::StrongTypePtr::operator=(struct c10::StrongTypePtr const &)” (_imp??4StrongTypePtr@c10@@QEAAAEAU01@AEBU01@@Z) referenced in function “public: struct c10::ivalue::Object & __cdecl c10::ivalue::Object::operator=(struct c10::ivalue::Object const &)” (??4Object@ivalue@c10@@QEAAAEAU012@AEBU012@@Z)	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\test_pytorch	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\example-app-debug.cpp.obj	1


Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol “__declspec(dllimport) public: struct c10::StrongTypePtr & __cdecl c10::StrongTypePtr::operator=(struct c10::StrongTypePtr &&)” (_imp??4StrongTypePtr@c10@@QEAAAEAU01@$$QEAU01@@Z) referenced in function “public: struct c10::ivalue::Object & __cdecl c10::ivalue::Object::operator=(struct c10::ivalue::Object &&)” (??4Object@ivalue@c10@@QEAAAEAU012@$$QEAU012@@Z)	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\test_pytorch	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\example-app-debug.cpp.obj	1


Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol “__declspec(dllimport) public: struct c10::ivalue::Future::FutureError & __cdecl c10::ivalue::Future::FutureError::operator=(struct c10::ivalue::Future::FutureError &&)” (_imp??4FutureError@Future@ivalue@c10@@QEAAAEAU0123@$$QEAU0123@@Z) referenced in function “public: class c10::optional & __cdecl c10::optional::operator=(struct c10::ivalue::Future::FutureError &&)” (??$?4UFutureError@Future@ivalue@c10@@@?$optional@UFutureError@Future@ivalue@c10@@@c10@@QEAAAEAV01@$$QEAUFutureError@Future@ivalue@1@@Z)	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\test_pytorch	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\example-app-debug.cpp.obj	1


Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol “__declspec(dllimport) protected: class c10::intrusive_ptr_target & __cdecl c10::intrusive_ptr_target::operator=(class c10::intrusive_ptr_target const &)” (_imp??4intrusive_ptr_target@c10@@IEAAAEAV01@AEBV01@@Z) referenced in function “public: struct c10::ivalue::Object & __cdecl c10::ivalue::Object::operator=(struct c10::ivalue::Object const &)” (??4Object@ivalue@c10@@QEAAAEAU012@AEBU012@@Z)	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\test_pytorch	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\example-app-debug.cpp.obj	1


Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol “public: virtual class at::Tensor & __cdecl torch::autograd::AutogradMeta::grad(void)” (?grad@AutogradMeta@autograd@torch@@UEAAAEAVTensor@at@@XZ)	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\test_pytorch	C:\Users\dawachat\Desktop\test_pytorch\out\build\x64-Rel\example-app-debug.cpp.obj	1

Following is my cmake code

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(example-app-debug)
add_executable(example-app-debug example-app-debug.cpp)
set(TORCH_INCLUDE_DIRS “C:/Users/dawachat/Desktop/example-app-debug/libtorch/include/” “C:/Users/dawachat/Desktop/example-app-debug/libtorch/include/torch/csrc/api/include”)
include_directories(${TORCH_INCLUDE_DIRS})
set(torch_lib “${tp}/asmjit.lib”)
#set(torch_lib “${tp}/clog.lib”)
list(APPEND torch_lib “${tp}/clog.lib”)
list(APPEND torch_lib “${tp}/cpuinfo.lib”)
list(APPEND torch_lib “${tp}/cpuinfo_internals.lib”)
list(APPEND torch_lib “${tp}/libprotobuf.lib”)
list(APPEND torch_lib “${tp}/libprotobuf-lite.lib”)
list(APPEND torch_lib “${tp}/libprotoc.lib”)
list(APPEND torch_lib “${tp}/onnx_proto.lib”)
list(APPEND torch_lib “${tp}/onnx.lib”)
list(APPEND torch_lib “${tp}/c10.lib”)
list(APPEND torch_lib “${tp}/fbgemm.lib”)
#list(APPEND torch_lib “${tp}/dnnl.lib”)
#list(APPEND torch_lib “${tp}/mkldnn.lib”)
list(APPEND torch_lib “${tp}/fmt.lib”)
list(APPEND torch_lib “${tp}/foxi_loader.lib”)
list(APPEND torch_lib “${tp}/caffe2_protos.lib”)
list(APPEND torch_lib “${tp}/Caffe2_perfkernels_avx.lib”)
list(APPEND torch_lib “${tp}/Caffe2_perfkernels_avx2.lib”)
list(APPEND torch_lib “${tp}/Caffe2_perfkernels_avx512.lib”)
set(torch_whole “${tp}/torch_cpu.lib”)
message ( STATUS “libraries: ${torch_lib}” )
message ( STATUS “libraries: ${torch_whole}” )
target_link_libraries(example-app-debug PUBLIC ${torch_lib})
target_link_libraries(example-app-debug PUBLIC -WHOLEARCHIVE:"${tp}/torch.lib")
target_link_libraries(example-app-debug PUBLIC -WHOLEARCHIVE:"${torch_whole}")