The headers are not wrapped with extern "C" {} , which causes major problems when using with a C++ project. An example follows:
extern "C" {
#include <relic/relic.h>
}
This code internally also includes gmp. (if relic is built with gmp).
Now, since it is a c++ code, #ifdef __cplusplus segments are enabled causing it to import some C++ specific codes (specifically templates).
A hack I am using is to import gmp above that. Once it is imported, the header guards prevent relic to reimport it and thus avoiding the error :)
The headers are not wrapped with extern "C" {} , which causes major problems when using with a C++ project. An example follows:
This code internally also includes gmp. (if relic is built with gmp). Now, since it is a c++ code,
#ifdef __cplusplus
segments are enabled causing it to import some C++ specific codes (specifically templates).A hack I am using is to import gmp above that. Once it is imported, the header guards prevent relic to reimport it and thus avoiding the error :)
@abhimp suggested to wrap each relic header file with extern "C". Example: https://github.com/relic-toolkit/relic/blob/9206ae50b667de160fcc385ba3dc2c920143ab0a/src/md/blake2.h#L27-L29
If you @dfaranha give the green signal I will work on this next week.