Solved by theycallmefm in post #2 
              
              
                There was a macro in another library which has same name as a typename in Libtorch library(which was a macro called V in my case), that’s why it was confused in compilation.