2017-01-10 95 views
0

我正在尝试构建MQTT Auth Plugin并面临问题。我遵循可用的说明@http://www.yasith.me/2016/04/securing-mqtt-connection-using.html来做到这一点。这里是我得到的错误 -MQTT Auth插件 - 构建问题

Using mosquitto source dir: /home/vagrant/Repos/mosquitto/mqtt/mosquitto 
OpenSSL install dir:  /usr/bin 

If you changed the backend selection, you might need to 'make clean' first 

CFLAGS: -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include 
LDFLAGS: -L/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ 
LDADD: -lcurl -L/usr/bin/lib -lcrypto -lmosquitto 

cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o auth-plug.o auth-plug.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o base64.o base64.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o pbkdf2-check.o pbkdf2-check.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o log.o log.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o envs.o envs.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o hash.o hash.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o be-psk.o be-psk.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o backends.o backends.c 
cc -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/src/ -I/home/vagrant/Repos/mosquitto/mqtt/mosquitto/lib/ -fPIC -Wall -Werror -DBE_HTTP -I/src -DDEBUG=1 -I/usr/bin/include -c -o cache.o cache.c 
cache.c: In function 'sha_hash': 
cache.c:48:3: error: implicit declaration of function 'EVP_MD_CTX_new' [-Werror=implicit-function-declaration] 
cache.c:48:23: error: initialization makes pointer from integer without a cast [-Werror] 
cache.c:53:3: error: implicit declaration of function 'EVP_MD_CTX_free' [-Werror=implicit-function-declaration] 
cc1: all warnings being treated as errors 
make: *** [cache.o] Error 1 

我config.mk文件看起来像 -

# Select your backends from this list 
BACKEND_CDB ?= no 
BACKEND_MYSQL ?= no 
BACKEND_SQLITE ?= no 
BACKEND_REDIS ?= no 
BACKEND_POSTGRES ?= no 
BACKEND_LDAP ?= no 
BACKEND_HTTP ?= yes 
BACKEND_JWT ?= no 
BACKEND_MONGO ?= no 

# Specify the path to the Mosquitto sources here 
MOSQUITTO_SRC =/home/vagrant/Repos/mosquitto/mqtt/mosquitto 

# Specify the path the OpenSSL here 
OPENSSLDIR = /usr/bin 

# Specify optional/additional linker flags here 
LDFLAGS = 

我在Linux VM(流浪者)这样做 - 不知道这是否会令任何差异。我能够看到所有apt-get按预期安装软件包。

有什么建议吗?

+0

@jpmens - 任何指导表示赞赏。提前致谢。 – Satya

回答

0

我相信这取决于你正在使用的openssl版本。 EVP_MD_CTX_new()仅适用于openssl 1.1.0。

+0

hi @ralight ..你知道UNIX OS min要求是什么吗?我在“Linux precise64 3.2.0-23-generic#36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux”上试过,似乎有一个破碎的lib路径情况。在此框中强制升级到openssl 1.1.0后,“openssl version”命令现在返回 - “加载共享库时出现openssl:error:libssl.so.1.1:无法打开共享对象文件:没有此文件或目录”。 ..不知道如何继续。谢谢。 – Satya