Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindgen issue? #29

Closed
DominoTree opened this issue Nov 26, 2017 · 7 comments
Closed

Bindgen issue? #29

DominoTree opened this issue Nov 26, 2017 · 7 comments

Comments

@DominoTree
Copy link

Not sure what I'm doing wrong here, but it looks like bindgen is spitting out some duplicate definitions when I'm trying to link against ImageMagick 7.0.7-11. Any thoughts? Thanks!

error[E0428]: the name `FP_INT_UPWARD` is defined multiple times    
    --> /home/nprice/Projects/wallaby/target/debug/build/magick_rust-3098943e623803c3/out/bindings.rs:3353:1                             
     |                            
748  | pub const FP_INT_UPWARD: libc::c_uint = 0;                   
     | ------------------------------------------ previous definition of the value `FP_INT_UPWARD` here                                  
...                               
3353 | pub const FP_INT_UPWARD: _bindgen_ty_1 = _bindgen_ty_1::FP_INT_UPWARD;                                                            
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_INT_UPWARD` redefined here                             
     |                            
     = note: `FP_INT_UPWARD` must be defined only once in the value namespace of this module                                             

error[E0428]: the name `FP_INT_DOWNWARD` is defined multiple times  
    --> /home/nprice/Projects/wallaby/target/debug/build/magick_rust-3098943e623803c3/out/bindings.rs:3354:1                             
     |                            
749  | pub const FP_INT_DOWNWARD: libc::c_uint = 1;                 
     | -------------------------------------------- previous definition of the value `FP_INT_DOWNWARD` here                              
...                               
3354 | pub const FP_INT_DOWNWARD: _bindgen_ty_1 = _bindgen_ty_1::FP_INT_DOWNWARD;                                                        
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_INT_DOWNWARD` redefined here                       
     |                            
     = note: `FP_INT_DOWNWARD` must be defined only once in the value namespace of this module                                           

error[E0428]: the name `FP_INT_TOWARDZERO` is defined multiple times                                                                     
    --> /home/nprice/Projects/wallaby/target/debug/build/magick_rust-3098943e623803c3/out/bindings.rs:3355:1                             
     |                            
750  | pub const FP_INT_TOWARDZERO: libc::c_uint = 2;               
     | ---------------------------------------------- previous definition of the value `FP_INT_TOWARDZERO` here                          
...                               
3355 | pub const FP_INT_TOWARDZERO: _bindgen_ty_1 = _bindgen_ty_1::FP_INT_TOWARDZERO;                                                    
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_INT_TOWARDZERO` redefined here                 
     |                            
     = note: `FP_INT_TOWARDZERO` must be defined only once in the value namespace of this module                                         

error[E0428]: the name `FP_INT_TONEARESTFROMZERO` is defined multiple times                                                              
    --> /home/nprice/Projects/wallaby/target/debug/build/magick_rust-3098943e623803c3/out/bindings.rs:3356:1                             
     |                            
751  |   pub const FP_INT_TONEARESTFROMZERO: libc::c_uint = 3;      
     |   ----------------------------------------------------- previous definition of the value `FP_INT_TONEARESTFROMZERO` here          
...                               
3356 | / pub const FP_INT_TONEARESTFROMZERO: _bindgen_ty_1 =        
3357 | |     _bindgen_ty_1::FP_INT_TONEARESTFROMZERO;               
     | |____________________________________________^ `FP_INT_TONEARESTFROMZERO` redefined here                                          
     |                            
     = note: `FP_INT_TONEARESTFROMZERO` must be defined only once in the value namespace of this module                                  

error[E0428]: the name `FP_INT_TONEAREST` is defined multiple times 
    --> /home/nprice/Projects/wallaby/target/debug/build/magick_rust-3098943e623803c3/out/bindings.rs:3358:1                             
     |                            
752  | pub const FP_INT_TONEAREST: libc::c_uint = 4;                
     | --------------------------------------------- previous definition of the value `FP_INT_TONEAREST` here                            
...                               
3358 | pub const FP_INT_TONEAREST: _bindgen_ty_1 = _bindgen_ty_1::FP_INT_TONEAREST;                                                      
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `FP_INT_TONEAREST` redefined here                    
     |                            
     = note: `FP_INT_TONEAREST` must be defined only once in the value namespace of this module                                          

error: aborting due to 5 previous errors                            

error: Could not compile `magick_rust`.                             

To learn more, run the command again with --verbose.                
@DominoTree
Copy link
Author

Update: might be rust-lang/rust-bindgen#687

@nlfiedler
Copy link
Owner

I just updated the Dockerfile to the latest version of ImageMagick (7.0.7-11) and didn't see any problem with the docker build. Also, macOS seems fine, too, with the same version installed via Homebrew. So, I don't know how this is happening, but it seems like you've found what could be the root cause. The question is why does it only happen under certain circumstances?

@spacekookie
Copy link

I'm having the same issue on Arch Linux with ImageMagick version 7.0.7.13.

The docker build doesn't produce the same error for me although fails because of something completely different 😅

gentoo90 added a commit to gentoo90/magick-rust that referenced this issue Dec 22, 2017
gentoo90 added a commit to gentoo90/magick-rust that referenced this issue Dec 22, 2017
@nlfiedler
Copy link
Owner

Thanks to gentoo90 we have a possible fix. If anyone affected by this could give the latest master a try and let me know if that helps, I would appreciate it. Thanks.

@DominoTree
Copy link
Author

Will give this a shot later today and report back.

@spacekookie
Copy link

I've just gotten the chance to test the merge and it works. It compiles and all the tests pass.

I would suggest to do a patch version bump and release a new version on crates.io 👍

@nlfiedler
Copy link
Owner

Excellent, glad it helped. I've published the 0.7.1 version of the crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants