Skip to content

Cannot find type _CharT in this scope (istream, ostream) #1480

@Chris00

Description

@Chris00

Describe the bug

When generating binding for mfem, I get the error

error[E0412]: cannot find type `_CharT` in this scope
 --> /home/trch/software/Rust/Scientific/mfem/target/debug/build/mfem-sys-3857909d484caabf/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:1777442
  |
1 | ...:: basic_ostream < _CharT > > , } # [repr (C)] pub struct basic_istre...
  |                       ^^^^^^ not found in this scope
  |
help: you might be missing a type parameter

The problematic code generated is

                pub struct basic_ostream_sentry {
                    _M_ok: bool,
                    _M_os: __bindgen_marker_Reference<*mut root::std::basic_ostream<_CharT>>,
                }

where _CharT is unbound — elsewhere it is used as a type parameter.

I don't know why autocxx goes so deep into the C++ standard library. It is possible to stop it at a higher level? In fact, i t would be nice if autocxx would already offer a high level Rust interface to istream and ostream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions