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

jwt::verifier<jwt::default_clock>::algo_base::~algo_base() unresolved reference #19

Closed
p4w4n opened this issue Apr 18, 2019 · 6 comments

Comments

@p4w4n
Copy link

p4w4n commented Apr 18, 2019

Hey,

Thanks for the great library. However when I am trying to compile the code I am getting an unresolved reference for jwt::verifierjwt::default_clock::algo_base::~algo_base().

Error: unresolved references found.
jwt::verifierjwt::default_clock::algo_base::~algo_base()

Can you please help.

Thanks a lot!!!

@Thalhammer
Copy link
Owner

What compiler/OS are you using?
Any special compiler flags?

@p4w4n
Copy link
Author

p4w4n commented Apr 18, 2019

cpp --version
cpp (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)

@Thalhammer
Copy link
Owner

Do you get the error when trying to compile the test cases?
gcc 4.8.5 is pretty old, make sure you compile with -std=c++11

@p4w4n
Copy link
Author

p4w4n commented Apr 19, 2019 via email

@Thalhammer
Copy link
Owner

Do you think commenting out the virtual destructor will have and adverse effect?

Yes absolutely. The virtual destructor is needed to allow the algorithm to be destroyed. If you remove it you WILL leak memory everytime you create/destory a verifier.

You can try replacing the line

virtual ~algo_base() = default;

with

virtual ~algo_base() {}

This might fix it, if it compiles fine otherwise.

@p4w4n
Copy link
Author

p4w4n commented Apr 19, 2019

Do you think commenting out the virtual destructor will have and adverse effect?

Yes absolutely. The virtual destructor is needed to allow the algorithm to be destroyed. If you remove it you WILL leak memory everytime you create/destory a verifier.

You can try replacing the line

virtual ~algo_base() = default;

with

virtual ~algo_base() {}

This might fix it, if it compiles fine otherwise.

Thanks a lot!!! Converting it to a function resolved the issue. :)

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