如何调用Paillier库的功能

时间:2019-06-10 23:39:54

标签: c++ c call gmp paillier

我想在C ++环境中调用paillier库(http://acsc.cs.utexas.edu/)的功能。我找到了有用的网站(Typedef function with void * pointer),并跟随Niemand在2015年2月10日12:40回答的评论。但是,我的代码输出错误消息如下。

enter image description here

感谢您提出的解决问题的意见。我的详细步骤如下。

  1. 编译和安装gmp库(具有默认选项)

    • gmp.h在/ usr / local / include中生成
    • 在/ usr / local / lib中生成
    • libgmp.a,libgmp.so,libgmp.la等
  2. 编译和安装paillier库(具有默认选项)

    • paillier.h在/ usr / local / include中生成
    • libpaillier.a在/ usr / local / lib
    • 中生成
  3. paillier库测试的示例代码

enter image description here

  1. 在Eclipse中设置项目的属性以使用库

    在[属性]-[C / C ++构建]-[设置]-[工具设置]中,

    • [GCC C ++编译器]-[包含]-[包含路径]:输入“ / usr / local / include”
    • [GCC C编译器]-[包含]-[包含路径]:输入“ / usr / local / include”
    • [GCC C ++链接器]-[库]-[库搜索路径]:输入“ / usr / local / lib”
    • [GCC C ++链接器]-[库]-[库]:输入“ gmp”,“ paillier”

enter image description here

我的环境的版本如下

  • ubuntu:18.04.2
  • eclipse:2019-03
  • gmp:6.1.2
  • paillier:0.8

1 个答案:

答案 0 :(得分:1)

如果切换链接顺序会怎样?也就是说,使用输入“ paillier”,“ gmp”。尤其对于静态库,链接顺序很重要。