mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.37k stars 306 forks source link

gcc4.8 error with cbindegen vers 0.25.0 install #885

Open xx-zhang opened 1 year ago

xx-zhang commented 1 year ago

gcc4.8 error with cbindegen vers 0.25.0 install. and then i change gcc with 9.5.1 then install ok. cbindgen c connecter comps is c++11? why 4.8.5 not ok? i change the rust vers with 1.64 also not run well.

my question: if i must use gcc4.8. how can i do it with rust ways. like rust 1.62 wuth musl and others?

best wish to you.

this is some error context.

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/raw_str.rs:1464:14
     |
1464 |         impl PartialEq<$type> for $other_type {
     |              ^^^^^^^^^ not found in this scope
...
1478 | r#impl!(RawOsString, &str);
     | -------------------------- in this macro invocation
     |
     = note: this error originates in the macro `impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/raw_str.rs:1455:14
     |
1455 |         impl PartialEq<$other_type> for $type {
     |              ^^^^^^^^^ not found in this scope
...
1479 | r#impl!(RawOsString, String);
     | ---------------------------- in this macro invocation
     |
     = note: this error originates in the macro `impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0412]: cannot find type `String` in this scope
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/raw_str.rs:1479:22
     |
1479 | r#impl!(RawOsString, String);
     |                      ^^^^^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/raw_str.rs:1464:14
     |
1464 |         impl PartialEq<$type> for $other_type {
     |              ^^^^^^^^^ not found in this scope
...
1479 | r#impl!(RawOsString, String);
     | ---------------------------- in this macro invocation
     |
     = note: this error originates in the macro `impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:314:8
    |
314 |     S: Into<Cow<'a, [u8]>>,
    |        ^^^^ not found in this scope

error[E0405]: cannot find trait `ToOwned` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:335:41
    |
335 | pub trait OsStrBytes: private::Sealed + ToOwned {
    |                                         ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:364:12
    |
364 |         S: Into<Cow<'a, [u8]>>;
    |            ^^^^ not found in this scope

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:401:16
    |
401 |             S: Into<Cow<'a, [u8]>>;
    |                ^^^^ not found in this scope

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:429:12
    |
429 |         S: Into<Cow<'a, [u8]>>,
    |            ^^^^ not found in this scope

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:437:12
    |
437 |         S: Into<Cow<'a, [u8]>>,
    |            ^^^^ not found in this scope

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:452:12
    |
452 |         S: Into<Cow<'a, [u8]>>,
    |            ^^^^ not found in this scope

error[E0405]: cannot find trait `Into` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:460:12
    |
460 |         S: Into<Cow<'a, [u8]>>,
    |            ^^^^ not found in this scope

error[E0405]: cannot find trait `Sized` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:477:44
    |
477 | pub trait OsStringBytes: private::Sealed + Sized {
    |                                            ^^^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:504:36
    |
504 |     fn assert_from_raw_vec(string: Vec<u8>) -> Self;
    |                                    ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:539:33
    |
539 |         fn from_raw_vec(string: Vec<u8>) -> Result<Self>;
    |                                 ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:560:30
    |
560 |     fn into_raw_vec(self) -> Vec<u8>;
    |                              ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:565:36
    |
565 |     fn assert_from_raw_vec(string: Vec<u8>) -> Self {
    |                                    ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:570:29
    |
570 |     fn from_raw_vec(string: Vec<u8>) -> Result<Self> {
    |                             ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:575:30
    |
575 |     fn into_raw_vec(self) -> Vec<u8> {
    |                              ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:582:36
    |
582 |     fn assert_from_raw_vec(string: Vec<u8>) -> Self {
    |                                    ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:587:29
    |
587 |     fn from_raw_vec(string: Vec<u8>) -> Result<Self> {
    |                             ^^^ not found in this scope

error[E0412]: cannot find type `Vec` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:592:30
    |
592 |     fn into_raw_vec(self) -> Vec<u8> {
    |                              ^^^ not found in this scope

error[E0412]: cannot find type `String` in this scope
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/os_str_bytes-6.5.1/src/lib.rs:617:22
    |
617 |     impl Sealed for &String {}
    |                      ^^^^^^ not found in this scope

Some errors have detailed explanations: E0405, E0412, E0425, E0432, E0433, E0463, E0531.