编译mosquitto-1.4.5 报错
Tofloor
poster avatar
liushiyi
deepin
2017-07-28 19:57
Author
在编译时这种错误,不知道大家遇到过没有,怎么解决呢?
read_handle_server.c: In function ‘mqtt3_handle_connect’:
read_handle_server.c:351:4: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
    context->username = _mosquitto_strdup((char *)ASN1_STRING_data(name_entry->value));
    ^~~~~~~
In file included from /usr/include/openssl/bn.h:31:0,
                 from /usr/include/openssl/asn1.h:24,
                 from /usr/include/openssl/objects.h:916,
                 from /usr/include/openssl/evp.h:27,
                 from /usr/include/openssl/x509.h:23,
                 from /usr/include/openssl/ssl.h:50,
                 from ../lib/mosquitto_internal.h:27,
                 from ./mosquitto_broker.h:23,
                 from read_handle_server.c:22:
/usr/include/openssl/asn1.h:553:1: note: declared here
DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
^
read_handle_server.c:351:77: error: dereferencing pointer to incomplete type ‘X509_NAME_ENTRY {aka struct X509_name_entry_st}’
    context->username = _mosquitto_strdup((char *)ASN1_STRING_data(name_entry->value));
                                                                             ^~
Makefile:54: recipe for target 'read_handle_server.o' failed
make[1]: *** [read_handle_server.o] Error 1
make[1]: Leaving directory '/home/liushiyi/tools/mosquitto-1.4.5/src'
Makefile:21: recipe for target 'mosquitto' failed
make: *** [mosquitto] Error 2


Reply Favorite View the author
All Replies
avatar
jingle
deepin
2017-07-28 21:18
#1
编译什么应用?
Reply View the author
avatar
wildlife
deepin
2017-07-28 21:47
#2
Reply View the author
avatar
134******40
deepin
2017-07-28 22:01
#3
本帖最后由 jdocker 于 2017-7-28 14:07 编辑

按照3楼的做法即可。不过我稍微做点调整。加入了创建build目录,使用cmake的过程。

  1. wget -c https://github.com/eclipse/mosquitto/archive/v1.4.11.tar.gz
  2. tar zxvf v1.4.11.tar.gz
  3. cd mosquitto-1.4.11

  4. sudo apt install cmake g++ libssl-dev libc-ares-dev uuid-dev xsltproc docbook-xsl

  5. mkdir build
  6. cd build

  7. cmake ..
  8. make
  9. sudo make install
Copy the Code
Reply View the author
avatar
134******40
deepin
2017-07-28 22:08
#4
刚刚写错了,请将qmake修改为cmake
Reply View the author
avatar
俗人的假笑
deepin
2022-02-09 23:22
#5

我也遇到了同样的问题,你们问题解决了吗

Reply View the author