Issue
I am trying to build mariadb++ (mariadb connector/c) on a new installation of linux mint. My process looks like this:
$ git clone https://github.com/MariaDB/mariadb-connector-c.git
$ mkdir build && cd build
$ cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr
This all runs fine, the problem occurs on my call to make
.
$ make
output:
Scanning dependencies of target client_ed25519
[ 0%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ed25519.c.o
[ 1%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ref10/fe_0.c.o
[ 2%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ref10/fe_isnegative.c.o
[ 2%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ref10/fe_sub.c.o
[ 3%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ref10/ge_p1p1_to_p2.c.o
[ 4%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ref10/ge_p3_to_cached.c.o
[ 4%] Building C object CMakeFiles/client_ed25519.dir/plugins/auth/ref10/open.c.o
In file included from /home/riley/mariadb-connector-c/plugins/auth/ref10/crypto_hash_sha512.h:2:0,
from /home/riley/mariadb-connector-c/plugins/auth/ref10/open.c:3:
/home/riley/mariadb-connector-c/include/ma_crypt.h:74:1: error: unknown type name ‘MA_HASH_CTX’; did you mean ‘MA_HASH_MD5’?
MA_HASH_CTX *ma_hash_new(unsigned int algorithm, MA_HASH_CTX *ctx);
^~~~~~~~~~~
MA_HASH_MD5
/home/riley/mariadb-connector-c/include/ma_crypt.h:74:50: error: unknown type name ‘MA_HASH_CTX’; did you mean ‘MA_HASH_MD5’?
MA_HASH_CTX *ma_hash_new(unsigned int algorithm, MA_HASH_CTX *ctx);
^~~~~~~~~~~
MA_HASH_MD5
/home/riley/mariadb-connector-c/include/ma_crypt.h:83:19: error: unknown type name ‘MA_HASH_CTX’; did you mean ‘MA_HASH_MD5’?
void ma_hash_free(MA_HASH_CTX *ctx);
^~~~~~~~~~~
MA_HASH_MD5
/home/riley/mariadb-connector-c/include/ma_crypt.h:96:20: error: unknown type name ‘MA_HASH_CTX’; did you mean ‘MA_HASH_MD5’?
void ma_hash_input(MA_HASH_CTX *ctx,
^~~~~~~~~~~
MA_HASH_MD5
/home/riley/mariadb-connector-c/include/ma_crypt.h:108:21: error: unknown type name ‘MA_HASH_CTX’; did you mean ‘MA_HASH_MD5’?
void ma_hash_result(MA_HASH_CTX *ctx, unsigned char *digest);
^~~~~~~~~~~
MA_HASH_MD5
/home/riley/mariadb-connector-c/include/ma_crypt.h: In function ‘ma_hash’:
/home/riley/mariadb-connector-c/include/ma_crypt.h:155:3: error: unknown type name ‘MA_HASH_CTX’; did you mean ‘MA_HASH_MD5’?
MA_HASH_CTX *ctx= NULL;
^~~~~~~~~~~
MA_HASH_MD5
/home/riley/mariadb-connector-c/include/ma_crypt.h:160:8: warning: implicit declaration of function ‘ma_hash_new’; did you mean ‘ma_hash’? [-Wimplicit-function-declaration]
ctx= ma_hash_new(algorithm, ctx);
^~~~~~~~~~~
ma_hash
/home/riley/mariadb-connector-c/include/ma_crypt.h:160:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
ctx= ma_hash_new(algorithm, ctx);
^
/home/riley/mariadb-connector-c/include/ma_crypt.h:161:3: warning: implicit declaration of function ‘ma_hash_input’; did you mean ‘ma_hash’? [-Wimplicit-function-declaration]
ma_hash_input(ctx, buffer, buffer_length);
^~~~~~~~~~~~~
ma_hash
/home/riley/mariadb-connector-c/include/ma_crypt.h:162:3: warning: implicit declaration of function ‘ma_hash_result’; did you mean ‘ma_hash’? [-Wimplicit-function-declaration]
ma_hash_result(ctx, digest);
^~~~~~~~~~~~~~
ma_hash
/home/riley/mariadb-connector-c/include/ma_crypt.h:163:3: warning: implicit declaration of function ‘ma_hash_free’; did you mean ‘ma_hash’? [-Wimplicit-function-declaration]
ma_hash_free(ctx);
^~~~~~~~~~~~
ma_hash
CMakeFiles/client_ed25519.dir/build.make:206: recipe for target 'CMakeFiles/client_ed25519.dir/plugins/auth/ref10/open.c.o' failed
make[2]: *** [CMakeFiles/client_ed25519.dir/plugins/auth/ref10/open.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/client_ed25519.dir/all' failed
make[1]: *** [CMakeFiles/client_ed25519.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
Obviously something is missing for the build... But how do I fix it? Or is there an easier way to install
Solution
OK, I just confirmed on a playpen VM that w/o libssl-dev
installed I get the same error.
Run apt install libssl-dev
and try again, starting with cmake .. -DCMAKE_INSTALL_PREFIX=/usr
Answered By - tink