I am using Visual Studio 2019 on Windows 10
I have built the tensorflow.dll, tensorflow.lib, and the header files for the C API using the tensorflow git repo for v2.11.0
I have linked these libraries to my Visual Studio solution.
This is the code I am running:
#include <iostream>
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/public/session.h"
#include "tensorflow/core/public/version.h"
using namespace tensorflow;
int main(int argc, char* argv[]) {
// Create a Session running TensorFlow locally in process.
std::cout << "hello world" << std::endl;
std::unique_ptr<tensorflow::Session> session(tensorflow::NewSession({}));
return 0;
}
The build fails and these are the errors I receive:
LNK2019 → unresolved external symbol “public: virtual __thiscall tensorflow::ConfigProto::~ConfigProto(void)” (??1ConfigPrototensorflowUAEXZ) referenced in function “public: __thiscall tensorflow::SessionOptions::~SessionOptions(void)” (??1SessionOptionstensorflowQAEXZ)
LNK2019 → unresolved external symbol “__declspec(dllimport) public: __thiscall tensorflow::SessionOptions::SessionOptions(void)” (_imp??0SessionOptionstensorflowQAEXZ) referenced in function _main
LNK2019 → unresolved external symbol “__declspec(dllimport) class tensorflow::Session * __cdecl tensorflow::NewSession(struct tensorflow::SessionOptions const &)” (_imp?NewSessiontensorflowYAPAVSession1ABUSessionOptions1Z) referenced in function _main
I am not sure what to do, please help, thank you!