2

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

Riley Hughes
  • 1,344
  • 2
  • 12
  • 22
  • I **think** your problem lies here: `cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr` ... given the directory you created and `cd`'ed into `../mariadb-connector-c/` doesn't exist (I'm surprised you didn't get a cmake error earlier on) ... w/ the following invocation `mariadb-connector-c/build$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make` I just successfully built the connector, and I don't even have any trace of mariadb on my system. – tink Jan 28 '19 at 01:19
  • I still get the exact same error... I updated it above in my OP though to include where the error is being triggered – Riley Hughes Jan 28 '19 at 01:24
  • worth mentioning this is a brand new installation of mint. I have installed codeblocks, wxwidgets, mariadb, and that is all – Riley Hughes Jan 28 '19 at 01:25
  • Next guess ... looking at `./include/ma_crypt.h` I'm wondering whether you're missing dev packages for openssl or gnutls. – tink Jan 28 '19 at 01:40
  • 1
    Ah, CMake... You need to run `make V=1` or `make VERBOSE=1` so it stops hiding important information, like the compile command used. – jww Jan 28 '19 at 02:18

1 Answers1

7

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

tink
  • 14,342
  • 4
  • 46
  • 50