Closed valleyflowerbear closed 8 years ago
I'm not sure, it seems like something is afoot here:
fn opus_strerror(error: ::libc::c_int) -> *const ::libc::c_char;
fn opus_get_version_string() -> *const ::libc::c_char;
unsafe fn from_ptr<'a>(ptr: *const c_char) -> &'a CStr;
What are the actual mismatched type errors you are seeing?
/src/lib.rs:109:26: 109:56 error: mismatched types:
expected `*const u8`,
found `*const i8` [E0308]
/src/lib.rs:109 unsafe { CStr::from_ptr(ffi::opus_get_version_string()) }.to_str().unwrap()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/lib.rs:109:26: 109:56 help: run `rustc --explain E0308` to see a detailed explanation
/src/lib.rs:525:45: 525:69 error: mismatched types:
expected `*const u8`,
found `*const i8` [E0308]
/src/lib.rs:525 let description = unsafe { CStr::from_ptr(ffi::opus_strerror(code)) }.to_str().unwrap();
^~~~~~~~~~~~~~~~~~~~~~~~
/src/lib.rs:525:45: 525:69 help: run `rustc --explain E0308` to see a detailed explanation
As I suspected, it looks like mismatched versions of libc
are the root problem. For target arm-unknown-linux-gnueabi
:
opus_sys
), c_char = i8std
), c_char = u8I've opened https://github.com/lgvz/rust-opus/pull/3 in an effort to fix the root cause.
That explains it! Closing this for now.
This fixes the compile error on ARM.
Is there a better way to do this?