arun11299 / cpp-jwt

JSON Web Token library for C++
MIT License
387 stars 112 forks source link

Issue compiling the example #97

Closed NeleOb closed 1 year ago

NeleOb commented 1 year ago

Hi, I am trying to get the example to run. Creating the JWT Object works fine. The programm does not work any longer, as soon as I add the line "auto enc_str = obj.signature();" Please help.

My code:

/*C++ JWT 
https://github.com/arun11299/cpp-jwt*/
#include "cpp-jwt/include/jwt/jwt.hpp"

// other libraries
#include <iostream>
using namespace std;

int main(int, char**) {
    std::cout << "Hello, world!\n";

    // create Token 
    string key = "secret"; //Secret to use for the algorithm
    jwt::jwt_object obj{jwt::params::algorithm("HS256"), 
        jwt::params::payload({{"some", "payload"}}), 
        jwt::params::secret(key)};

    // encode Token 
    auto enc_str = obj.signature();

    // decode
    // auto dec_obj = jwt::decode(enc_str, algorithms({"HS256"}), secret(key));
    // std::cout << dec_obj.header() << std::endl;
    // std::cout << dec_obj.payload() << std::endl;

    return 0;
}

My CMakeLists.txt:

cmake_minimum_required(VERSION 3.0.0)
project(jwtpp_testrun VERSION 0.1.0)

include(CTest)
enable_testing()

add_library(cpp-jwt cpp-jwt/include/jwt)
include_directories(cpp-jwt/include)
target_include_directories(cpp-jwt INTERFACE cpp-jwt/include)
set_target_properties(cpp-jwt PROPERTIES LINKER_LANGUAGE CXX)

add_executable(jwtpp_testrun tests_cpp_2.cpp)

target_link_libraries(jwtpp_testrun cpp-jwt
)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

My Output:

main] Building folder: jwtpp 
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/dev/Documents/Examples/jwtpp/build --config Debug --target all -j 6 --
[build] [ 33%] Built target cpp-jwt
[build] Scanning dependencies of target jwtpp_testrun
[build] [ 66%] Building CXX object CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o
[build] [100%] Linking CXX executable bin/jwtpp_testrun
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::HS256::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:83: undefined reference to `EVP_sha256'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::HS384::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:94: undefined reference to `EVP_sha384'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::HS512::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:105: undefined reference to `EVP_sha512'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::RS256::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:129: undefined reference to `EVP_sha256'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::RS384::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:142: undefined reference to `EVP_sha384'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::RS512::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:155: undefined reference to `EVP_sha512'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::ES256::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:168: undefined reference to `EVP_sha256'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::ES384::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:181: undefined reference to `EVP_sha384'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::algo::ES512::operator()()':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:194: undefined reference to `EVP_sha512'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::bio_deletor(bio_st*)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:274: undefined reference to `BIO_free_all'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::evp_md_ctx_deletor(evp_md_ctx_st*)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:281: undefined reference to `EVP_MD_CTX_free'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::ec_key_deletor(ec_key_st*)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:288: undefined reference to `EC_KEY_free'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::ec_sig_deletor(ECDSA_SIG_st*)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:295: undefined reference to `ECDSA_SIG_free'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::ev_pkey_deletor(evp_pkey_st*)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:302: undefined reference to `EVP_PKEY_free'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::HMACSign<jwt::algo::HS256>::sign[abi:cxx11](jwt::basic_string_view<char, std::char_traits<char> >, jwt::basic_string_view<char, std::char_traits<char> >)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:359: undefined reference to `HMAC'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::HMACSign<jwt::algo::HS384>::sign[abi:cxx11](jwt::basic_string_view<char, std::char_traits<char> >, jwt::basic_string_view<char, std::char_traits<char> >)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:359: undefined reference to `HMAC'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::HMACSign<jwt::algo::HS512>::sign[abi:cxx11](jwt::basic_string_view<char, std::char_traits<char> >, jwt::basic_string_view<char, std::char_traits<char> >)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/algorithm.hpp:359: undefined reference to `HMAC'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::RS256>::load_key(jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:182: undefined reference to `BIO_new_mem_buf'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:190: undefined reference to `PEM_read_bio_PrivateKey'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:198: undefined reference to `EVP_PKEY_id'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::RS256>::evp_digest[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:215: undefined reference to `EVP_MD_CTX_new'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:222: undefined reference to `EVP_DigestSignInit'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:229: undefined reference to `EVP_DigestUpdate'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:236: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:245: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::RS384>::load_key(jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:182: undefined reference to `BIO_new_mem_buf'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:190: undefined reference to `PEM_read_bio_PrivateKey'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:198: undefined reference to `EVP_PKEY_id'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::RS384>::evp_digest[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:215: undefined reference to `EVP_MD_CTX_new'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:222: undefined reference to `EVP_DigestSignInit'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:229: undefined reference to `EVP_DigestUpdate'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:236: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:245: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::RS512>::load_key(jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:182: undefined reference to `BIO_new_mem_buf'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:190: undefined reference to `PEM_read_bio_PrivateKey'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:198: undefined reference to `EVP_PKEY_id'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::RS512>::evp_digest[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:215: undefined reference to `EVP_MD_CTX_new'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:222: undefined reference to `EVP_DigestSignInit'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:229: undefined reference to `EVP_DigestUpdate'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:236: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:245: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES256>::load_key(jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:182: undefined reference to `BIO_new_mem_buf'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:190: undefined reference to `PEM_read_bio_PrivateKey'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:198: undefined reference to `EVP_PKEY_id'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES256>::evp_digest[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:215: undefined reference to `EVP_MD_CTX_new'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:222: undefined reference to `EVP_DigestSignInit'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:229: undefined reference to `EVP_DigestUpdate'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:236: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:245: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES256>::public_key_ser[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:264: undefined reference to `EVP_PKEY_get1_EC_KEY'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:271: undefined reference to `EC_KEY_get0_group'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:271: undefined reference to `EC_GROUP_get_degree'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:277: undefined reference to `d2i_ECDSA_SIG'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:290: undefined reference to `ECDSA_SIG_get0'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:292: undefined reference to `BN_num_bits'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:293: undefined reference to `BN_num_bits'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:304: undefined reference to `BN_bn2bin'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:305: undefined reference to `BN_bn2bin'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES384>::load_key(jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:182: undefined reference to `BIO_new_mem_buf'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:190: undefined reference to `PEM_read_bio_PrivateKey'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:198: undefined reference to `EVP_PKEY_id'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES384>::evp_digest[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:215: undefined reference to `EVP_MD_CTX_new'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:222: undefined reference to `EVP_DigestSignInit'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:229: undefined reference to `EVP_DigestUpdate'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:236: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:245: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES384>::public_key_ser[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:264: undefined reference to `EVP_PKEY_get1_EC_KEY'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:271: undefined reference to `EC_KEY_get0_group'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:271: undefined reference to `EC_GROUP_get_degree'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:277: undefined reference to `d2i_ECDSA_SIG'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:290: undefined reference to `ECDSA_SIG_get0'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:292: undefined reference to `BN_num_bits'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:293: undefined reference to `BN_num_bits'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:304: undefined reference to `BN_bn2bin'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:305: undefined reference to `BN_bn2bin'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES512>::load_key(jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:182: undefined reference to `BIO_new_mem_buf'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:190: undefined reference to `PEM_read_bio_PrivateKey'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:198: undefined reference to `EVP_PKEY_id'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES512>::evp_digest[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:215: undefined reference to `EVP_MD_CTX_new'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:222: undefined reference to `EVP_DigestSignInit'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:229: undefined reference to `EVP_DigestUpdate'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:236: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:245: undefined reference to `EVP_DigestSignFinal'
[build] /usr/bin/ld: CMakeFiles/jwtpp_testrun.dir/tests_cpp_2.cpp.o: in function `jwt::PEMSign<jwt::algo::ES512>::public_key_ser[abi:cxx11](evp_pkey_st*, jwt::basic_string_view<char, std::char_traits<char> >, std::error_code&)':
[build] /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:264: undefined reference to `EVP_PKEY_get1_EC_KEY'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:271: undefined reference to `EC_KEY_get0_group'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:271: undefined reference to `EC_GROUP_get_degree'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:277: undefined reference to `d2i_ECDSA_SIG'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:290: undefined reference to `ECDSA_SIG_get0'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:292: undefined reference to `BN_num_bits'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:293: undefined reference to `BN_num_bits'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:304: undefined reference to `BN_bn2bin'
[build] /usr/bin/ld: /home/dev/Documents/Examples/jwtpp/cpp-jwt/include/jwt/impl/algorithm.ipp:305: undefined reference to `BN_bn2bin'
[build] collect2: error: ld returned 1 exit status
[build] make[2]: *** [CMakeFiles/jwtpp_testrun.dir/build.make:85: bin/jwtpp_testrun] Error 1
[build] make[1]: *** [CMakeFiles/Makefile2:106: CMakeFiles/jwtpp_testrun.dir/all] Error 2
[build] make: *** [Makefile:117: all] Error 2
[proc] The command: /usr/bin/cmake --build /home/dev/Documents/Examples/jwtpp/build --config Debug --target all -j 6 -- exited with code: 2 and signal: null
[build] Build finished with exit code 2
arun11299 commented 1 year ago

The error messages are because it is most likely not linking to the openssl library. It needs openssl to sign the assertion.

NeleOb commented 1 year ago

It works now after re-installing. Thank you.