rust-lang / rust-lang/rust-bindgen
Tutorial demo project bzip cannot be compiled with GNU toolchain on Windows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
I'v got tutorial bzip2 demo project and add C source files.
got compiler error:
under MSVC toolchain it compiled but some complains on generated bindings.
under GNU toolchain it cannot be compiled. the error:
Compiling bindgen-tutorial-bzip2-sys v0.1.0 (D:\bindgen-tutorial-bzip2-sys-master)
error: failed to run custom build command for `bindgen-tutorial-bzip2-sys v0.1.0 (D:\bindgen-tutorial-bzip2-sys-master)`
process didn't exit successfully: `D:\bindgen-tutorial-bzip2-sys-master\target\debug\build\bindgen-tutorial-bzip2-sys-6642fcf83988627d\build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=bz2
--- stderr
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vadefs.h:28:33: error: expected ';' after top level declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:83:1: error: expected identifier
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:83:20: error: expected ';' after top level declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:180:29: error: expected ';' after top level declarator
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:283:51: error: unknown type name 'uintptr_t'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:284:67: error: unknown type name 'uintptr_t'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:288:8: error: unknown type name 'uintptr_t'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:296:1: error: a parameter list without types is only allowed in a function definition
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:12:1: error: expected function body after function declarator
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:287:16: error: unknown type name 'uintptr_t'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:561:13: error: unknown type name 'size_t'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:2010:1: error: a parameter list without types is only allowed in a function definition
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_stdio_config.h:12:1: error: expected function body after function declarator
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_stdio_config.h:31:10: error: Unsupported architecture
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:31:14: error: unknown type name 'FILE'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:49:17: error: unknown type name 'FILE'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:58:17: error: unknown type name 'FILE'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:67:17: error: unknown type name 'FILE'
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:79:38: error: unknown type name 'FILE'
fatal error: too many errors emitted, stopping now [-ferror-limit=]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vadefs.h:28:33: error: expected ';' after top level declarator, err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:83:1: error: expected identifier, err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:83:20: error: expected ';' after top level declarator, err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:180:29: error: expected ';' after top level declarator, err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:283:51: error: unknown type name 'uintptr_t', err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:284:67: error: unknown type name 'uintptr_t', err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:288:8: error: unknown type name 'uintptr_t', err: true
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\vcruntime.h:296:1: error: a parameter list without types is only allowed in a function definition, err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:12:1: error: expected function body after function declarator, err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:287:16: error: unknown type name 'uintptr_t', err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:561:13: error: unknown type name 'size_t', err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:2010:1: error: a parameter list without types is only allowed in a function definition, err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_stdio_config.h:12:1: error: expected function body after function declarator, err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_stdio_config.h:31:10: error: Unsupported architecture, err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:31:14: error: unknown type name 'FILE', err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:49:17: error: unknown type name 'FILE', err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:58:17: error: unknown type name 'FILE', err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:67:17: error: unknown type name 'FILE', err: true
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:79:38: error: unknown type name 'FILE', err: true
fatal error: too many errors emitted, stopping now [-ferror-limit=], err: true
thread 'main' panicked at 'Unable to generate bindings: ()', src\libcore\result.rs:997:5
stack backtrace:
0: std::sys_common::backtrace::_print
at src\libstd\sys\windows\backtrace/mod.rs:95
at src\libstd\sys\windows\backtrace/mod.rs:82
at src\libstd\sys_common/backtrace.rs:71
1: std::panicking::default_hook::{{closure}}
at src\libstd\sys_common/backtrace.rs:59
at src\libstd/panicking.rs:200
2: std::panicking::default_hook
at src\libstd/panicking.rs:215
3: std::panicking::rust_panic_with_hook
at src\libstd/panicking.rs:478
4: std::panicking::continue_panic_fmt
at src\libstd/panicking.rs:385
5: rust_begin_unwind
at src\libstd/panicking.rs:312
6: core::panicking::panic_fmt
at src\libcore/panicking.rs:85
7: core::result::unwrap_failed
at /rustc/350674b7180a41c8e508d93c6ab8e203b69d3df7\src\libcore/macros.rs:17
8: <core::result::Result<T, E>>::expect
at /rustc/350674b7180a41c8e508d93c6ab8e203b69d3df7\src\libcore/result.rs:825
9: build_script_build::main
at .\build.rs:9
10: std::rt::lang_start::{{closure}}
at /rustc/350674b7180a41c8e508d93c6ab8e203b69d3df7\src\libstd/rt.rs:64
11: std::panicking::try::do_call
at src\libstd/rt.rs:49
at src\libstd/panicking.rs:297
12: _rust_maybe_catch_panic
at src\libpanic_unwind/lib.rs:87
13: std::rt::lang_start_internal
at src\libstd/panicking.rs:276
at src\libstd/panic.rs:388
at src\libstd/rt.rs:48
14: std::rt::lang_start
at /rustc/350674b7180a41c8e508d93c6ab8e203b69d3df7\src\libstd/rt.rs:64
15: main
16: _tmainCRTStartup
17: mainCRTStartup
18: unit_addrs_search
19: unit_addrs_search
Process finished with exit code 101
the demo project is available here
LLVM-7.0.1-win64
bindgen = "0.47.3"
sorry for nonformatted style.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the tutorial bzip2 demo with bindgen 0.47.3, LLVM 7.0.1, and the GNU toolchain on Windows. Start at build.rs:9 and inspect the binding-generation failure around the MSVC and Windows SDK headers. Done means the demo project compiles with the GNU toolchain without the reported generated-binding errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, rust
- Domain
- build-system, devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100