sxlllslgh / TensorFlow-Windows-Binaries

Prebuilt binaries of TensorFlow on Windows
7 stars 1 forks source link

missing references when linking 'hello world' program #1

Open esohns opened 2 months ago

esohns commented 2 months ago

error LNK2019: unresolved external symbol "public: __cdecl tensorflow::Input::Initializer::Initializer(class std::initializer_list const &)" error LNK2019: unresolved external symbol "public: static class tensorflow::Scope cdecl tensorflow::Scope::NewRootScope(void)" error LNK2019: unresolved external symbol "private: class tensorflow::Scope cdecl tensorflow::Scope::WithOpNameImpl(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)const " error LNK2019: unresolved external symbol "public: cdecl tensorflow::ClientSession::ClientSession(class tensorflow::Scope const &)" error LNK2019: unresolved external symbol "public: cdecl tensorflow::ClientSession::~ClientSession(void)" error LNK2019: unresolved external symbol "public: class tensorflow::Status cdecl tensorflow::ClientSession::Run(class std::vector<class tensorflow::Output,class std::allocator > const &,class std::vector<class tensorflow::Tensor,class std::allocator > *)const " error LNK2019: unresolved external symbol "class tensorflow::Output cdecl tensorflow::ops::Const(class tensorflow::Scope const &,struct tensorflow::Input::Initializer const &)" error LNK2019: unresolved external symbol "public: __cdecl tensorflow::ops::MatMul::MatMul(class tensorflow::Scope const &,class tensorflow::Input,class tensorflow::Input,struct tensorflow::ops::MatMul::Attrs const &)"

I just checked that your binaries are 64bit, so that's not the problem...

sxlllslgh commented 2 months ago

Sorry for not being able to reply to you in a timely manner. Please double check if the linker path is configured correctly for link issues. The simplest way is to place the DLL in the same directory as the EXE file.

esohns commented 2 months ago

Thanks for your reply. It's definitely linking in tensorflow_cc.lib, so that is not the problem. It seems that the import library does not contain all the symbols, however. BTW, is there a chance that you will upload newer versions of the library ?

I found this issue which could be related: https://github.com/tensorflow/tensorflow/issues/41904

esohns commented 2 months ago

logfile.txt FYI I used dumpbin.exe to analyze the import library tensorflow_cc.lib and it seems the symbols are indeed missing (I searched for "ClientSession" in the logfile and found no results)

sxlllslgh commented 1 month ago

Sorry for taking so long to reply to you. Because it has been so long, I can't find the project compiled at that time to find out the reason for this problem. I also tried to recompile the latest version (2.18) according to my notes, but encountered some new problems that have not been solved. In addition, I noticed that since 2.11, TensorFlow no longer provides CUDA compilation support under Windows, but recommends using WSL2. I also want to know your needs to decide which version I should compile first.

esohns commented 1 month ago

Thanks for your reply. I don't have any specific requirements to use CUDA, so no worries there.

sxlllslgh commented 1 month ago

After a week of painful struggle, I finally successfully compiled the Python package of 2.18.0-rc0, but the C++ one is still stuck on the link error. I tried to modify the compilation configuration but couldn't find a solution, so I just filed an issue tensorflow/tensorflow#77156 with the official.

esohns commented 1 month ago

OK. Thank you for your efforts. I think all of this is worthwhile, because others will struggle with this as well.