arun11299 / cpp-jwt

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

Error while building #63

Open sudo-panda opened 4 years ago

sudo-panda commented 4 years ago

I am building the library on Ubuntu 18.04. First of all cmake --build . -j gives me Unknown argument -j so I tried building using cmake --build .. Which proceeds to give me this error:

Added to this gist to shorten issue

I am not sure why these errors appear. But they are related to GTest and OpenSSL libraries.

NJ261 commented 4 years ago

I have tried to reproduce the issue with docker and Conan.

Conan sets compiler.libcxx to libstdc++ for backward compatibility link and GTest 1.10 requires the new implementation of std::string. So set the compiler.libcxx to libstdc++11.

You can also set the compiler version while installing missing dependency like: conan install .. --build missing -s compiler.libcxx=libstdc++11.

Please find docker file here for reference:

FROM ubuntu:18.04

RUN apt-get -y clean && apt-get -y update && apt-get -y upgrade && apt-get -y install python3-pip cmake && pip3 install conan

COPY . /cpp-jwt

WORKDIR /cpp-jwt

RUN mkdir build \
        && cd build \
        && conan install .. --build missing -s compiler.libcxx=libstdc++11 \
        && cmake .. \
        && cmake --build .

Hope that it resolves your issue.

sudo-panda commented 4 years ago

@NJ261 is there a way to build it without conan?

arun11299 commented 4 years ago

There has been really good contribution from @gocarlos and others on the overall build side. @gocarlos Do you have anything to say on the build question ? Thanks

gocarlos commented 4 years ago

@NJ261 is there a way to build it without conan?

sure, the cmake build system here is not depending on conan. you can use conan, debian packages, vcpkg, or install the needed packages manually to your system

all cmake does is using the find_package functionality which the package manager can provide, though not mandatory.

gocarlos commented 4 years ago

is this not working for you?

https://github.com/arun11299/cpp-jwt#using-debian