ZenGo-X / class

Rust library for building IQC: cryptography based on class groups of imaginary quadratic orders
GNU General Public License v3.0
63 stars 31 forks source link

Build fails [Linux] #17

Closed amanusk closed 5 years ago

amanusk commented 5 years ago

When building on Linux, the build fails:

error[E0428]: the name `FP_NAN` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8839:1
     |
448  | pub const FP_NAN: u32 = 0;
     | -------------------------- previous definition of the value `FP_NAN` here
...
8839 | pub const FP_NAN: _bindgen_ty_13 = 0;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_NAN` redefined here
     |
     = note: `FP_NAN` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_INFINITE` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8840:1
     |
449  | pub const FP_INFINITE: u32 = 1;
     | ------------------------------- previous definition of the value `FP_INFINITE` here
...
8840 | pub const FP_INFINITE: _bindgen_ty_13 = 1;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_INFINITE` redefined here
     |
     = note: `FP_INFINITE` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_ZERO` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8841:1
     |
450  | pub const FP_ZERO: u32 = 2;
     | --------------------------- previous definition of the value `FP_ZERO` here
...
8841 | pub const FP_ZERO: _bindgen_ty_13 = 2;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_ZERO` redefined here
     |
     = note: `FP_ZERO` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_SUBNORMAL` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8842:1
     |
451  | pub const FP_SUBNORMAL: u32 = 3;
     | -------------------------------- previous definition of the value `FP_SUBNORMAL` here
...
8842 | pub const FP_SUBNORMAL: _bindgen_ty_13 = 3;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_SUBNORMAL` redefined here
     |
     = note: `FP_SUBNORMAL` must be defined only once in the value namespace of this module

error[E0428]: the name `FP_NORMAL` is defined multiple times
    --> /home/amanusk/rust/class-groups/target/debug/build/class_group-ada77e612876b7ac/out/bindings.rs:8843:1
     |
452  | pub const FP_NORMAL: u32 = 4;
     | ----------------------------- previous definition of the value `FP_NORMAL` here
...
8843 | pub const FP_NORMAL: _bindgen_ty_13 = 4;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_NORMAL` redefined here
     |
     = note: `FP_NORMAL` must be defined only once in the value namespace of this module

Seems that bindgen is generating some duplicate bindings then fails to build.

I was able to build by updating build.rs to this: https://github.com/amanusk/class-groups/blob/fix-duplicate-bindings/build.rs Need to make sure this does not break anything

omershlo commented 5 years ago

cool thanks. Can you also submit a PR? I will check if the mac build breaks or not