How to call the functions of paillier library

179 Views Asked by At

I want to call the functions of paillier library (http://acsc.cs.utexas.edu/) in C++ environment. I found out the helpful site (Typedef function with void * pointer) and followed the comment answered Feb 10 '15 at 12:40 from Niemand. But, my code output error messages as follows.

enter image description here

I appreciate your any comments to solve the problems. My detail procedures is as follows.

  1. Compiling and installing gmp library (with default option)

    • gmp.h is generated in /usr/local/include
    • libgmp.a, libgmp.so, libgmp.la, etc are generated in /usr/local/lib
  2. Compiling and installing paillier library (with default option)

    • paillier.h is generated in /usr/local/include
    • libpaillier.a is generated in /usr/local/lib
  3. Sample code for paillier library test

enter image description here

  1. Setting properties for project in eclipse to use libraries

    In [Properties] - [C/C++ Build] - [Settings] - [Tool Settings],

    • [GCC C++ Compiler] - [includes] - [Include paths] : input "/usr/local/include"
    • [GCC C Compiler] - [includes] - [Include paths] : input "/usr/local/include"
    • [GCC C++ Linker] - [Libraries] - [Library search path] : input "/usr/local/lib"
    • [GCC C++ Linker] - [Libraries] - [Libraries] : input "gmp", "paillier"

enter image description here

My environment's version is as follows

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

There are 1 best solutions below

0
On BEST ANSWER

What happens if you switch the link order? That is, use input "paillier", "gmp". Especially with static libraries, link order is important.