Libtorch compile link flags

Hi team,
when upgrade from 1.7.0cu110 to 1.9.0cu111 or 1.11.0cu113,
compile link flags(CMakefile):

works for ver 1.7.0cu110 but doesn’t do the trick for the newer version,otherwise when run app it will warning entry point “?set_fw_gradAutogradMetaautogradtorchUEAAXAEBVTensorBaseat0_K_NZ” not found

    any solution?Thanks.

image

Solved.
set_target_properties(AAA PROPERTIES LINK_FLAGS “-INCLUDE:?_torch_cuda_cu_linker_symbol_op_cuda@native@at@@YA?AVTensor@2@AEBV32@@Z”)

libtorch with Cuda 11.3 not linked properly on Windows using Visual Studio 2022 · Issue #72396 · pytorch/pytorch (github.com)