I've got hello world program working for cross compilation (armv7) and tried to do the same for a slightly complex crate which involves bindings and wrappers to a C library.
What is successful for native compilation is failing while doing cross compilation with below errors
src/lib.rs:66:56: 66:76 error: mismatched types:
expected `*const u8`,
found `*const i8`
(expected u8,
found i8) [E0308]
src/lib.rs:66 client.mosquitto = bindings::mosquitto_new(id.unwrap().as_ptr(),
^~~~~~~~~~~~~~~~~~~~
src/lib.rs:66:56: 66:76 help: run `rustc --explain E0308` to see a detailed explanation
Here are my bindings and wrappers
Bindings
pub fn mosquitto_new(id: *const ::libc::c_char, clean_session: u8,
obj: *mut ::libc::c_void) -> *mut Struct_mosquitto;
Wrapper over binding
unsafe {
client.mosquitto = bindings::mosquitto_new(id.unwrap().as_ptr(),
true as u8,
ptr::null_mut());
What is the reason for this behavior? How do I fix this?