【问题标题】:error trying to build mariadb connector-c on linux mint. How to fix?尝试在 linux mint 上构建 mariadb connector-c 时出错。怎么修?
【发布时间】:2019-06-20 23:53:53
【问题描述】:

我正在尝试在新安装的 linux mint 上构建 mariadb++ (mariadb connector/c)。我的流程是这样的:

$ git clone https://github.com/MariaDB/mariadb-connector-c.git
$ mkdir build && cd build
$ cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr

这一切运行良好,问题发生在我致电make

$ make

输出:

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

显然构建中缺少一些东西......但是我该如何修复它?或者有没有更简单的安装方法

【问题讨论】:

  • 认为您的问题出在此处:cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr ... 鉴于您创建的目录和cd'ed 到 ../mariadb-connector-c/ 不存在(我'我很惊讶您之前没有收到 cmake 错误)...使用以下调用 mariadb-connector-c/build$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make 我刚刚成功构建了连接器,而且我的系统上什至没有任何 mariadb 痕迹。
  • 我仍然得到完全相同的错误...我在上面的 OP 中更新了它,但包括触发错误的位置
  • 值得一提的是,这是全新安装的薄荷。我已经安装了代码块、wxwidgets、mariadb,仅此而已
  • 下一个猜测...看着./include/ma_crypt.h 我想知道您是否缺少openssl 或gnutls 的开发包。
  • 啊,CMake...您需要运行make V=1make VERBOSE=1,这样它就不会隐藏重要信息,例如使用的编译命令。

标签: linux mariadb linux-mint mariadb-connector-c


【解决方案1】:

好的,我刚刚在未安装 libssl-dev 的 playpen 虚拟机上确认我遇到了同样的错误。

运行apt install libssl-dev 并重试,从cmake .. -DCMAKE_INSTALL_PREFIX=/usr 开始

【讨论】:

  • 在 msys2 上,pacman -S openssl-devel 解决了这个问题。
猜你喜欢
  • 2019-04-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-24
  • 2011-11-28
相关资源
最近更新 更多