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

Not working when compiled but working on visual studio #43

Closed
eric72 opened this issue Sep 18, 2019 · 12 comments
Closed

Not working when compiled but working on visual studio #43

eric72 opened this issue Sep 18, 2019 · 12 comments

Comments

@eric72
Copy link

eric72 commented Sep 18, 2019

Hi,

Maybe you know where my problem come from, the verification for the token work when i test on visual studio, but then, when i've compiled and test from the compiled code, the token is always false.

Maybe some missed links for the compiled code and the function return an error or something ?
Thanks for you help.

@eric72
Copy link
Author

eric72 commented Sep 18, 2019

I think i need to make a dll of it on my release folder

@Thalhammer
Copy link
Owner

You cant build a dll of jwt-cpp, as its header only.
However it uses OpenSSL under the hood, so make sure a correct openssl dll is present in your library path and release folder. I don't use Visual Studio (or Windows) so I'am not sure if I am of much help.
You could try to print the exception message and see if it gives any clue.

@eric72
Copy link
Author

eric72 commented Sep 19, 2019

you mean an openssl.dll ?
On windows it's a openssl.exe

@Thalhammer
Copy link
Owner

Unless you linked your project against a static build of openssl (which is not the default as far as I know) there should be an openssl.dll somewhere.

@eric72
Copy link
Author

eric72 commented Sep 20, 2019

And on Linux, you don't have this problem ?
Just use the .h and it can compile ?
Because i would like to compile for linux too

@Thalhammer
Copy link
Owner

On linux you also need to link against openssl but almost every linux system has it installed and unlike windows you dont need a copy of the dll per programm but it uses one per system. So its much less of a problem.

@eric72
Copy link
Author

eric72 commented Sep 20, 2019

I've tried many thing but, my project work only from Visual Studio, but when i start it from the exe it doesn't work, i don't understand why, i tested why nuget too, and linked some lib manually but it's the same

@Thalhammer
Copy link
Owner

@eric72 Is there some kind of error message or something the like.

@eric72
Copy link
Author

eric72 commented Sep 20, 2019

"failed to load public key: PEM_read_bio_PUBKEY failed"

but it's working fine when i compile with Visual Studio

@Thalhammer
Copy link
Owner

@eric72 Are you sure it is actually compiled correctly ?
If you load the key from a file, are you sure its read correctly.

@eric72
Copy link
Author

eric72 commented Sep 20, 2019

Oh man you right, i found the problem thanks my friend i was focus somewhere else

@Thalhammer
Copy link
Owner

No problem, I am happy to help :)

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