libneo4j-client
libneo4j-client copied to clipboard
openssl_iostream.c error
Hello, I was trying to recompile the lib from source on Ubuntu 18.04 with gcc 7.5.0 and openssl 1.1.1d. The following error occurred:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -pthread -I/usr/local/include -Wpedantic -Wvla -g -O2 -std=gnu11 -fvisibility=hidden -pipe -Wall -W -Werror -Wno-unused-parameter -Wno-missing-field-initializers -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wcast-align -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -MT libneo4j_client_la-openssl_iostream.lo -MD -MP -MF .deps/libneo4j_client_la-openssl_iostream.Tpo -c openssl_iostream.c -fPIC -DPIC -o .libs/libneo4j_client_la-openssl_iostream.o openssl_iostream.c:56:1: error: variable ‘_iostream_bio_method’ has initializer but incomplete type static BIO_METHOD _iostream_bio_method = { ^~~~~~ openssl_iostream.c:57:5: error: excess elements in struct initializer [-Werror] BIO_TYPE_FILTER, ^~~~~~~~~~~~~~~ openssl_iostream.c:57:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:58:5: error: excess elements in struct initializer [-Werror] "neo4j_openssl_iostream", ^~~~~~~~~~~~~~~~~~~~~~~~ openssl_iostream.c:58:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:59:5: error: excess elements in struct initializer [-Werror] iostream_bio_write, ^~~~~~~~~~~~~~~~~~ openssl_iostream.c:59:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:60:5: error: excess elements in struct initializer [-Werror] iostream_bio_read, ^~~~~~~~~~~~~~~~~ openssl_iostream.c:60:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:61:5: error: excess elements in struct initializer [-Werror] iostream_bio_puts, ^~~~~~~~~~~~~~~~~ openssl_iostream.c:61:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:62:5: error: excess elements in struct initializer [-Werror] iostream_bio_gets, ^~~~~~~~~~~~~~~~~ openssl_iostream.c:62:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:63:5: error: excess elements in struct initializer [-Werror] iostream_bio_ctrl, ^~~~~~~~~~~~~~~~~ openssl_iostream.c:63:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:64:5: error: excess elements in struct initializer [-Werror] iostream_bio_create, ^~~~~~~~~~~~~~~~~~~ openssl_iostream.c:64:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c:65:5: error: excess elements in struct initializer [-Werror] iostream_bio_destroy ^~~~~~~~~~~~~~~~~~~~ openssl_iostream.c:65:5: note: (near initialization for ‘_iostream_bio_method’) openssl_iostream.c: In function ‘neo4j_openssl_iostream’: openssl_iostream.c:68:38: error: dereferencing pointer to incomplete type ‘BIO {aka struct bio_st}’ #define BIO_set_data(bio, value) (bio->ptr = (value)) ^ openssl_iostream.c:121:5: note: in expansion of macro ‘BIO_set_data’ BIO_set_data(iostream_bio, delegate); ^~~~~~~~~~~~ openssl_iostream.c: At top level: openssl_iostream.c:56:19: error: storage size of ‘_iostream_bio_method’ isn’t known static BIO_METHOD _iostream_bio_method = { ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Makefile:784: recipe for target 'libneo4j_client_la-openssl_iostream.lo' failed make[3]: *** [libneo4j_client_la-openssl_iostream.lo] Error 1
Any idea what could be the reason? Thanks a lot!
Incredibly, I may know the fix for this. OpenSSL 1.1.1 made a bunch of breaking changes to its API from 1.0.2. Luckily, @cleishm made it possible to use the new API, but it is currently obscure.
Try configuring as follows
CFLAGS="-DHAVE_BIO_METH_NEW" ./configure
and make from there.
It works! thank you!