crossbario / autobahn-cpp

WAMP for C++ in Boost/Asio
https://crossbar.io/autobahn
Boost Software License 1.0
251 stars 104 forks source link

error: 'HMAC_CTX_free' was not declared in this scope #155

Closed AlexMarlo closed 7 years ago

AlexMarlo commented 7 years ago

I install all as in readme on Ubuntu

this is my dockerfile

FROM ubuntu:14.04
RUN apt-get update && apt-get install -y build-essential cmake libevent-dev libgtest-dev libjsoncpp-dev wget autotools-dev autoconf libboost-all-dev git libbz2-dev libssl-dev libtool
RUN cd /usr/src/gtest/ && mkdir build && cd build && cmake .. && make && cp libgtest* /usr/lib/
RUN cd ~ && git clone https://github.com/msgpack/msgpack-c.git && cd msgpack-c && git checkout cpp-1.4.2 && cmake -DMSGPACK_CXX11=ON . && make install
RUN cd ~ && git clone https://github.com/zaphoyd/websocketpp.git && cd websocketpp && cmake . && make install
RUN cd ~ && git clone https://github.com/crossbario/autobahn-cpp.git && cd autobahn-cpp && cp -r autobahn/ /usr/include/

and i have this error inside library

In file included from /usr/local/include/autobahn/wamp_session.ipp:48:0,
                 from /usr/local/include/autobahn/wamp_session.hpp:387,
                 from /usr/local/include/autobahn/autobahn.hpp:42,
                 from ../../src/main.cpp:1:
/usr/local/include/autobahn/wamp_auth_utils.hpp: In function 'std::string compute_wcs(const string&, const string&)':
/usr/local/include/autobahn/wamp_auth_utils.hpp:162:35: error: 'HMAC_CTX_new' was not declared in this scope
     HMAC_CTX *hmac = HMAC_CTX_new();
                                   ^
/usr/local/include/autobahn/wamp_auth_utils.hpp:168:23: error: 'HMAC_CTX_free' was not declared in this scope
     HMAC_CTX_free(hmac);
oberstet commented 7 years ago

try this: https://github.com/crossbario/crossbar-docker/blob/master/autobahn-cpp/x86_64/Dockerfile.gcc

or try deriving from ubuntu 16.04 image ..

AlexMarlo commented 7 years ago

it looks like i have old version of openssl on ubuntu:14.04

AlexMarlo commented 7 years ago

On ubuntu 16.04 i have same error I have OpenSSL 1.0.2g 1 Mar 2016

and looks like HMAC_CTX appeared in openssl 1.1

oberstet commented 7 years ago

yes, openssl on 14.04 is "old". same for boost. ok, so ubuntu 16.04 is also too old;)

as you already use Docker, solution is easy: derive from OS images that have the latest bits (eg I had issues with jessie also .. hence we derive from stretch).

the change was introduces here https://github.com/crossbario/autobahn-cpp/commit/53d1362dd8de43609e92fc112cdc079cc94e0950

fwiw, we don't want to go through the hassles of autoconf, detect old openssls etc

AlexMarlo commented 7 years ago

in your docker file https://github.com/msgpack/msgpack-c/archive/cpp-1.4.2.zip is deleted

oberstet commented 7 years ago

what do you mean by "deleted"? it's installed here https://github.com/crossbario/crossbar-docker/blob/master/autobahn-cpp/x86_64/Dockerfile.gcc#L37, and after that the tmp stuff is deleted ..

AlexMarlo commented 7 years ago

file https://github.com/msgpack/msgpack-c/archive/cpp-1.4.2.zip doesn't exist on github

oberstet commented 7 years ago

It does (for me):

oberstet@thinkpad-t430s:/tmp$ date
Mi 15. Mär 21:03:57 CET 2017
oberstet@thinkpad-t430s:/tmp$ wget https://github.com/msgpack/msgpack-c/archive/cpp-1.4.2.zip
--2017-03-15 21:04:00--  https://github.com/msgpack/msgpack-c/archive/cpp-1.4.2.zip
Auflösen des Hostnamen »github.com (github.com)«... 192.30.253.112, 192.30.253.113
Verbindungsaufbau zu github.com (github.com)|192.30.253.112|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 302 Found
Platz: https://codeload.github.com/msgpack/msgpack-c/zip/cpp-1.4.2 [folge]
--2017-03-15 21:04:00--  https://codeload.github.com/msgpack/msgpack-c/zip/cpp-1.4.2
Auflösen des Hostnamen »codeload.github.com (codeload.github.com)«... 192.30.253.120, 192.30.253.121
Verbindungsaufbau zu codeload.github.com (codeload.github.com)|192.30.253.120|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 698979 (683K) [application/zip]
In »»cpp-1.4.2.zip«« speichern.

cpp-1.4.2.zip                              100%[=======================================================================================>] 682,60K   945KB/s    in 0,7s    

2017-03-15 21:04:01 (945 KB/s) - »cpp-1.4.2.zip« gespeichert [698979/698979]

oberstet@thinkpad-t430s:/tmp$ 
oberstet commented 7 years ago

you need a http client that processes http 302 redirects ..