Thalhammer / jwt-cpp

A header only library for creating and validating json web tokens in c++
https://thalhammer.github.io/jwt-cpp/
MIT License
828 stars 229 forks source link

Build Errors For picojson.h? #330

Closed hkRho closed 4 months ago

hkRho commented 5 months ago

What's your question?

Hello,

I currently have jwt-cpp as a nuget package to my C++ Visual Studio project. For some reason, I'm encountering the following errors below when I try building the project, and was wondering if you have any insight into what might be causing it + how this could be fixed.

Thank you!

Additional Context

THE FOLLOWING BELOW IS IN THE packages.config:

package id="jwt-cpp" version="0.7.0" targetFramework="native" package id="openssl-vc141-static-x86_64" version="1.1.0" targetFramework="native" package id="PicoJSON" version="1.3.0" targetFramework="native"

THE FOLLOWING BELOW ARE THE ERRORS: Severity Code Description Project File Line Suppression State Details Error C2589 '(': illegal token on right side of '::' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C3878 syntax error: unexpected token '(' following 'expression' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C2760 syntax error: '<' was unexpected here; expected 'statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C2760 syntax error: ')' was unexpected here; expected 'expression' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C2760 syntax error: ')' was unexpected here; expected ';' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C3878 syntax error: unexpected token ')' following 'expression_statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C3878 syntax error: unexpected token ')' following 'statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C3878 syntax error: unexpected token ')' following 'selection_statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C3878 syntax error: unexpected token ')' following 'statement_seq' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C2760 syntax error: ')' was unexpected here; expected '}' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C3878 syntax error: unexpected token ')' following 'compound_statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C2065 'ival': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 779
Error C2065 'ival': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 780
Error C2589 '(': illegal token on right side of '::' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 780
Error C3878 syntax error: unexpected token '(' following 'expression' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 780
Error C2760 syntax error: ')' was unexpected here; expected ';' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 780
Error C3878 syntax error: unexpected token ')' following 'expression_statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 780
Error C2760 syntax error: ')' was unexpected here; expected 'expression' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 780
Error C2065 'endp': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 781
Error C2065 'num_str': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 781
Error C2065 'num_str': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 781
Error C2760 syntax error: ')' was unexpected here; expected ';' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 781
Error C3878 syntax error: unexpected token ')' following 'expression_statement' ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 781
Error C2065 'ival': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 782
Error C2065 'f': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 787
Error C2065 'num_str': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 787
Error C2065 'endp': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 787
Error C2065 'endp': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 788
Error C2065 'num_str': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 788
Error C2065 'num_str': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 788
Error C2065 'f': undeclared identifier ProjectName D:\FILEPATH\src\packages\PicoJSON.1.3.0\lib\native\include\picojson\picojson.h 789

prince-chrismc commented 5 months ago

What compuler and settings are you using? Do you have any extra compiler flags?

It would be amazing if you could provide more information to help reproduce the problem:)

hkRho commented 5 months ago

Hi @prince-chrismc, thank you for commenting! I'm on a Windows machine and hope the following below is the settings you asked about? image image

And for the extra compiler flags, I didn't change any of the property settings apart from adding to "Additional Include Directories"! (I hope I got what you meant)

hkRho commented 5 months ago

Just a bit of an update: I tried to put the jwt-cpp header files above "windows.h" as mentioned here and got different errors!


Error LNK2019 unresolved external symbol BIO_number_written referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_new referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_free referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_write referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_ctrl referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_push referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_free_all referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_s_mem referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_new_mem_buf referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_MD_CTX_new referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_MD_CTX_free referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_DigestInit_ex referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_DigestUpdate referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_DigestFinal_ex referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_DigestInit referenced in function "public: class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl jwt::algorithm::rsa::sign(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)const " (?sign@rsa@algorithm@jwt@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV45@AEAVerror_code@5@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_SignFinal referenced in function "public: class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl jwt::algorithm::rsa::sign(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)const " (?sign@rsa@algorithm@jwt@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV45@AEAVerror_code@5@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol BIO_f_base64 referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_sha256 referenced in function "public: struct evp_md_st const __cdecl ::operator()(void)const " (??R@@QEBAPEBUevp_md_st@@XZ) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_sha384 referenced in function "public: struct evp_md_st const
cdecl ::operator()(void)const " (??R@@QEBAPEBUevp_md_st@@XZ) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_sha512 referenced in function "public: cdecl jwt::algorithm::rs512::rs512(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0rs512@algorithm@jwt@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_PKEY_size referenced in function "public: class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl jwt::algorithm::rsa::sign(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)const " (?sign@rsa@algorithm@jwt@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV45@AEAVerror_code@5@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol EVP_PKEY_free referenced in function "private: static void __cdecl jwt::helper::evp_pkey_handle::decrement_ref_count(struct evp_pkey_st *)" (?decrement_ref_count@evp_pkey_handle@helper@jwt@@CAXPEAUevp_pkey_st@@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol i2d_X509_REQ_bio referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol X509_REQ_free referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol X509_free referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl jwt::helper::extract_pubkey_from_cert(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)" (?extract_pubkey_from_cert@helper@jwt@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@0AEAVerror_code@4@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol X509_get_pubkey referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl jwt::helper::extract_pubkey_from_cert(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)" (?extract_pubkey_from_cert@helper@jwt@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@0AEAVerror_code@4@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol PEM_read_bio_X509 referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator >
cdecl jwt::helper::extract_pubkey_from_cert(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)" (?extract_pubkey_from_cert@helper@jwt@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@0AEAVerror_code@4@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol PEM_read_bio_X509_REQ referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl ComputeDigestAsBase64Str(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?ComputeDigestAsBase64Str@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol PEM_read_bio_PrivateKey referenced in function "class jwt::helper::evp_pkey_handle __cdecl jwt::helper::load_private_key_from_string(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)" (?load_private_key_from_string@helper@jwt@@YA?AVevp_pkey_handle@12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AEAVerror_code@5@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol PEM_read_bio_PUBKEY referenced in function "class jwt::helper::evp_pkey_handle
cdecl jwt::helper::load_public_key_from_string(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)" (?load_public_key_from_string@helper@jwt@@YA?AVevp_pkey_handle@12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AEAVerror_code@5@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol PEM_write_bio_PUBKEY referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl jwt::helper::extract_pubkey_from_cert(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::error_code &)" (?extract_pubkey_from_cert@helper@jwt@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@0AEAVerror_code@4@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CertCreateCertificateContext referenced in function "void cdecl ConvertToPccert(wchar_t const &,struct _CERT_CONTEXT const &,struct _CERT_KEY_CONTEXT &)" (?ConvertToPccert@@YAXAEAPEB_WAEAPEBU_CERT_CONTEXT@@AEAU_CERT_KEY_CONTEXT@@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CertFreeCertificateContext referenced in function "void cdecl ConvertToPccert(wchar_t const &,struct _CERT_CONTEXT const &,struct _CERT_KEY_CONTEXT &)" (?ConvertToPccert@@YAXAEAPEB_WAEAPEBU_CERT_CONTEXT@@AEAU_CERT_KEY_CONTEXT@@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CertGetCertificateContextProperty referenced in function "void cdecl ConvertToPccert(wchar_t const &,struct _CERT_CONTEXT const &,struct _CERT_KEY_CONTEXT &)" (?ConvertToPccert@@YAXAEAPEB_WAEAPEBU_CERT_CONTEXT@@AEAU_CERT_KEY_CONTEXT@@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CryptAcquireCertificatePrivateKey referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl GenerateToken(class std::basic_string<char,struct std::char_traits,class std::allocator > &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?GenerateToken@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CertGetNameStringW referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl GetCertSubjectName(struct _CERT_CONTEXT const *)" (?GetCertSubjectName@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBU_CERT_CONTEXT@@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CertCreateCertificateChainEngine referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl GenerateToken(class std::basic_string<char,struct std::char_traits,class std::allocator > &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?GenerateToken@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CertGetCertificateChain referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl GenerateToken(class std::basic_string<char,struct std::char_traits,class std::allocator > &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?GenerateToken@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CryptStringToBinaryW referenced in function "void cdecl ConvertToPccert(wchar_t const &,struct _CERT_CONTEXT const &,struct _CERT_KEY_CONTEXT &)" (?ConvertToPccert@@YAXAEAPEB_WAEAPEBU_CERT_CONTEXT@@AEAU_CERT_KEY_CONTEXT@@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol
imp_CryptBinaryToStringA referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl Base64Encode(unsigned char const *,unsigned int64,unsigned int)" (?Base64Encode@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBE_KI@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1
Error LNK2019 unresolved external symbol "unsigned long cdecl apsdk::security::ApLookupLocalCert(enum apsdk::security::ApAuthType,struct _CERT_CONTEXT const &,enum apsdk::security::ApLookupFlags,char const )" (?ApLookupLocalCert@security@apsdk@@YAKW4ApAuthType@12@AEAPEBU_CERT_CONTEXT@@W4ApLookupFlags@12@PEBD@Z) referenced in function "class std::basic_string<char,struct std::char_traits,class std::allocator > cdecl GenerateToken(class std::basic_string<char,struct std::char_traits,class std::allocator > &,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?GenerateToken@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAV12@V12@@Z) PROJECTNAME D:\FILEPATH\src\PROJECTNAME\cryptoutilsAPSDK.obj 1

prince-chrismc commented 5 months ago

You should not need /permissive with such and old cpp std.

LNK2019 unresolved external symbol BIO_new means you are missing the linkage to OpenSSL

unresolved external symbol "unsigned long __cdecl apsdk::security::ApLookupLocalCert Seems like you have a larger app and no idea what that is :)

prince-chrismc commented 5 months ago

You might want to consider a package manager to help take care of setting these properties up. Nuget and Conan work with MSBuild and both have jwt-cpp :)

hkRho commented 5 months ago

Hi @prince-chrismc thank you for the suggestion and explanation of some of the errors! :) Just want to get an understanding of what might be causing this--is it because the packages that I have installed may be colliding? (is why you recommended looking into a package manager to sort this out?)

P.S. does jwt-cpp depend on PicoJSON? was wondering if I could uninstall the PicoJSON nuget pkg!

prince-chrismc commented 5 months ago

The errors are cause by the misconfiguration of your project. Having a tool that does it is far more likely to succeed :)

No, it does not, you can Uninstall itand disable it while providing your own JSON library. The docs should help you https://thalhammer.github.io/jwt-cpp/md_docs_2traits.html

prince-chrismc commented 4 months ago

Going to mark this as resolved, feel free to open a new one of you have more questions