Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing references when linking 'hello world' program #1

Open
esohns opened this issue Aug 15, 2024 · 7 comments
Open

missing references when linking 'hello world' program #1

esohns opened this issue Aug 15, 2024 · 7 comments

Comments

@esohns
Copy link

esohns commented Aug 15, 2024

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
Copy link
Owner

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
Copy link
Author

esohns commented Sep 7, 2024

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: tensorflow/tensorflow#41904

@esohns
Copy link
Author

esohns commented Sep 7, 2024

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
Copy link
Owner

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
Copy link
Author

esohns commented Oct 2, 2024

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

@sxlllslgh
Copy link
Owner

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
Copy link
Author

esohns commented Oct 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants