arun11299 / cpp-jwt

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

compile error with master #37

Closed darrenjs closed 5 years ago

darrenjs commented 5 years ago

Hi ... trying to build lastest version of master, but getting compile error below. I am trying to build the first example found on the main page.

However, I don't get this error with release v1.1.0

/home/build/opt/gcc-8.2.0/bin/g++ -MMD -MP -Wall -O0 -g3 -ggdb  -std=c++17 -I/home/build/opt/cpp-jwt/cpp-jwt/include   -c example.cc
example.cc: In function ‘int main()’:
example.cc:9:86: error: no matching function for call to ‘jwt::jwt_object::jwt_object(<brace-enclosed initializer list>)’
   jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), secret(key)};
                                                                                      ^
In file included from example.cc:2:
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:892:3: note: candidate: ‘template<class First, class ... Rest> jwt::jwt_object::jwt_object(std::enable_if_t<jwt::detail::meta::is_parameter_concept<First>::value, First>&&, Rest&& ...)’
   jwt_object(std::enable_if_t<detail::meta::is_parameter_concept<First>::value, First>&& first, Rest&&... rest);
   ^~~~~~~~~~
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:892:3: note:   template argument deduction/substitution failed:
example.cc:9:86: note:   couldn't deduce template parameter ‘First’
   jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), secret(key)};
                                                                                      ^
In file included from example.cc:2:
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:870:3: note: candidate: ‘jwt::jwt_object::jwt_object()’
   jwt_object() = default;
   ^~~~~~~~~~
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:870:3: note:   candidate expects 0 arguments, 3 provided
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note: candidate: ‘jwt::jwt_object::jwt_object(const jwt::jwt_object&)’
 class jwt_object
       ^~~~~~~~~~
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note:   candidate expects 1 argument, 3 provided
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note: candidate: ‘jwt::jwt_object::jwt_object(jwt::jwt_object&&)’
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note:   candidate expects 1 argument, 3 provided
makefile:23: recipe for target 'example.o' failed
arun11299 commented 5 years ago

Hello @darrenjs Can you please provide the compiler and the platform details ?

arun11299 commented 5 years ago

Never mind. I see the compiler in the snippet.

arun11299 commented 5 years ago

I have pushed a fix. Can you check it once ?

Thanks.

darrenjs commented 5 years ago

Fixed, thanks