问题
I can't build MariaDB 10.2 with RocksDB enabled, in CentOS 7.
It has the following compile error:
/root/mariadb-10.2/mysys_ssl/my_md5.cc: In function ‘void md5_result(MD5_CONTEXT*, uchar*)’: /root/mariadb-10.2/mysys_ssl/my_md5.cc:86:29: error: ‘EVP_MD_CTX_cleanup’ was not declared in this scope EVP_MD_CTX_cleanup(context);
^ /root/mariadb-10.2/mysys_ssl/my_md5.cc: In function ‘void my_md5(uchar*, const char*, size_t)’: /root/mariadb-10.2/mysys_ssl/my_md5.cc:102:15: error: aggregate ‘MD5_CONTEXT md5_context’ has incomplete type and cannot be defined MD5_CONTEXT md5_context;
^ /root/mariadb-10.2/mysys_ssl/my_md5.cc: In function ‘void my_md5_multi(uchar*, ...)’: /root/mariadb-10.2/mysys_ssl/my_md5.cc:127:15: error: aggregate ‘MD5_CONTEXT md5_context’ has incomplete type and cannot be defined MD5_CONTEXT md5_context;
^ /root/mariadb-10.2/mysys_ssl/my_md5.cc: In function ‘size_t my_md5_context_size()’: /root/mariadb-10.2/mysys_ssl/my_md5.cc:140:28: error: invalid application of ‘sizeof’ to incomplete type ‘MD5_CONTEXT {aka evp_md_ctx_st}’ return sizeof(MD5_CONTEXT);
^ make[2]: *** [mysys_ssl/CMakeFiles/mysys_ssl.dir/my_md5.cc.o] Error 1 make[1]: *** [mysys_ssl/CMakeFiles/mysys_ssl.dir/all] Error 2
Here is the commands I used to build it:
yum install g++ cmake libbz2-dev libaio-dev bison zlib1g-dev libsnappy-dev libgflags-dev libreadline6-dev libncurses5-dev libssl-dev liblz4-dev gdb git
git clone https://github.com/MariaDB/server.git mariadb-10.2
git checkout bb-10.2-mariarocks
git submodule init git submodule update
cmake -DCURSES_LIBRARY=/usr/lib64/libncurses -DCURSES_INCLUDE_PATH=/usr/include .
make -j10
I guess it's the OpenSSL version problem, maybe MariaDB supports older OpenSSL version only.
So, anyone knows how to fix it?
my versions:
- OpenSSL 1.1.0e 16 Feb 2017
- g++ (GCC) 4.8.5 20150623
Thanks,
回答1:
Support for OpenSSL 1.1 was added in MariaDB 10.2.6, which as of today (May 17, 2017) has not been released yet, but is expected to be very soon.
Since you are taking source code from github, you can try it now already, but you shouldn't be using bb-10.2-mariarocks
tree -- while it might have some newest experimental changes in RocksDB (or not), it is likely to be outdated in any other way. Please use 10.2
branch instead, it has RocksDB as well.
来源:https://stackoverflow.com/questions/44012487/error-incomplete-type-md5-context-with-mariadb-10-2-and-openssl-1-1-0e