pokowaka/jwt-cpp

Link error on linux

Closed this issue · 2 comments

On linux platform While linking with libjwt.a I am getting this weird link error for

.text._ZN14HS256ValidatorC2ERKSs[_ZN14HS256ValidatorC5ERKSs]+0x50): undefined reference to `HMACValidator::HMACValidator(std::string const&, env_md_st const*, std::string const&)'

When i comment call to this function everything is fine. Not sure what is going on. On windows everything is fine.

Let me see if I can reproduce this.

This is due to the order of how you specify the libraries you link against.

You need to link in the following order:

-ljwt -lssl -lcrypto

I will reply to the other issue in more detail explaining why