Reputation: 21
The following code fails to compile under tensorflow 1.13.1:
GraphDef graph_def;
status = ReadBinaryProto(Env::Default(), modelPath, &graph_def);
if (!status.ok()) {
std::cerr << "ReadBinaryProto Status:" << status.ToString() << endl;
return -1;
}
cout << "success." << endl;
int a = graph_def.node_size();
int i;
for (i = 0; i < a; i++)
{
graph_def.node(i).PrintDebugString();
}
return -1;
Compile error message
Unresolved external symbol "public: class google::protobuf::internal::LogMessage & __cdecl google::protobuf::internal::LogMessage::operator<<(char const *)" (??6LogMessage@internal@protobuf@google@@QEAAAEAV0123@PEBD@Z)
Unresolved external symbol "public: void __cdecl google::protobuf::internal::LogFinisher::operator=(class google::protobuf::internal::LogMessage &)" (??4LogFinisher@internal@protobuf@google@@QEAAXAEAVLogMessage@123@@Z)
Unresolved external symbol "public: void __cdecl google::protobuf::Message::PrintDebugString(void)const " (?PrintDebugString@Message@protobuf@google@@QEBAXXZ)
Unresolved external symbol "public: __cdecl google::protobuf::internal::LogMessage::LogMessage(enum google::protobuf::LogLevel,char const *,int)" (??0LogMessage@internal@protobuf@google@@QEAA@W4LogLevel@23@PEBDH@Z)
Unresolved external symbol "public: __cdecl google::protobuf::internal::LogMessage::~LogMessage(void)" (??1LogMessage@internal@protobuf@google@@QEAA@XZ)
all the above operations appeared under visual studio 2015.
Upvotes: 1
Views: 252
Reputation: 21
Add the code suggested in the compilation error message to the end of the file in the link.
File link to be modified:
https://github.com/guikarist/tensorflow-windows-build-script/blob/master/patches/tf_exported_symbols_msvc.lds
then recompile tensorflow.
refer to the following link for the entire compilation process.
https://blog.csdn.net/atpalain_csdn/article/details/97945536
Upvotes: 1