peterjc123:

It will be easier if you use CMake. If you stick to building the project using VS, then instead of dragging the directory of libtorch to your project, you should add the include directory(should be in Project settings/C++) and the libraries (should be in Project settings/Linker) in the project settings.


Hi,
Could you please help me resolve issues I’m facing while trying to compile a simple cpp+libtorch code in VS 2017 on Windows:

  
    
    
    Compiling cpp + libtorch code in VS 2017 C++
  
  
    Hello, 
Here’s my simple cpp code that just loads the model. I’m trying to compile this code in Windows 7, VS 2017. I’ve included path to libtorch/include to C++ include dirs & libtorch/lib to linker 
#define _CRT_SECURE_NO_WARNINGS
#include "torch/script.h"
#include <iostream>
#include <memory>
#include <fstream>


#include <stdint.h>
#include <vector>

typedef unsigned char BYTE;

using namespace std;

int main(int argc, const char* argv[]) {

if (argc != 3) {
std::cerr << "usage: example-app &…
  


Thanks a lot!