You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :)
@abhimp suggested to wrap each relic header file with extern "C".
Example:
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:
relic/src/md/blake2.h
Lines 27 to 29 in 9206ae5
If you @dfaranha give the green signal I will work on this next week.
The text was updated successfully, but these errors were encountered: