cpp-jwt icon indicating copy to clipboard operation
cpp-jwt copied to clipboard

Error while building

Open sudo-panda opened this issue 4 years ago • 5 comments

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.

sudo-panda avatar May 07 '20 00:05 sudo-panda

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.

NJ261 avatar Jun 11 '20 15:06 NJ261

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

sudo-panda avatar Jun 11 '20 16:06 sudo-panda

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

arun11299 avatar Jun 13 '20 07:06 arun11299

@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 avatar Jun 13 '20 09:06 gocarlos

is this not working for you?

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

gocarlos avatar Jun 13 '20 09:06 gocarlos