Thanks.
I’m also trying to create a new CPP project to run libtorch without cmake.
I tried to follow you instructions and I’m getting the following errors:
COMMANDS:
-
export install_root=mnt/c/CP/REPOSITORIES/CPU/libtorch-sh
ared-with-deps-latest/libtorch -
g++ PytorchTest.cpp -I${install_root}/include -I${install_root}/include/torch/csrc/api/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -L${install_root}/lib -Wl,-R${install_root}/lib -ltorch -ltorch_cpu -lc10 -o PytorchTest
ERROR
/usr/bin/ld: cannot find -ltorch
/usr/bin/ld: cannot find -ltorch_cpu
/usr/bin/ld: cannot find -lc10
collect2: error: ld returned 1 exit status
I see these libraries inside libtorch/lib.
Can you please help?