I am currently having issues finding the namespaces that match what the docs say based on how I have added the libtorch files to my project. Here is how I currently have imported libtorch into my project that does NOT use a Cmake build:
Project Properties->C/C+±>General->Additional Include Directories: C:\LibTorch\libtorch\include\torch\csrc\api\include
Project Properties->Linker->General->Additional Library Directories:
Project Properties->Linker->Input->Additional Dependencies:
Project Properties->Post-Build Event->Command Line:
xcopy /y “C:\LibTorch\libtorch\lib\c10.dll” “$(TargetDir)” && xcopy /y “C:\LibTorch\libtorch\lib\torch.dll” “$(TargetDir)”
when I write “#include torch/torch.h” I get the torch::data and torch::cuda namespaces. I have also tried, in additional include directories, C:\LibTorch\libtorch\include, #include torch/library.h and got something similar to some of the examples but its off. I can’t even do torch::Tensor ten or torch::nn::Module in either situation I get errors. Any help/guidance would be appreciated. I am trying to add this library into a large existing project that does not use a CMake build, so right now I will not be taking that route.
Thank you for your help,