cristicbz/rust-doom

Windows: Couldn't build on Windows 8 (gl-rs build fails)

Closed this issue · 3 comments

I don't often build anything with rust, so maybe I'm doing something wrong.

yuv@YUV13 /E/Games/rust-doom (master)
$ cargo build --release --verbose
Fresh rust-xml v0.1.0 (https://github.com/netvl/rust-xml#f86f02b3)
Fresh toml v0.1.0 (https://github.com/alexcrichton/toml-rs#8a3ba4c6)
Fresh sdl2 v0.0.1-alpha.1 (https://github.com/cristicbz/rust-sdl2?ref=sta
tic_to_const#c8c36cb6)
Fresh khronos_api v0.0.1 (https://github.com/bjz/gl-rs#feed7be3)
Compiling gl_generator v0.0.1 (https://github.com/bjz/gl-rs#feed7be3)
Running rustc lib.rs --crate-name gl_generator --crate-type dylib --opt-le vel 3 --cfg ndebug -C metadata=cda8351b0c2935af -C extra-filename=-cda8351b0c293 5af --out-dir E:\Games\rust-doom\target\release\deps --dep-info E:\Games\rust-do om\target\release\.fingerprint\gl_generator-cda8351b0c2935af\dep-lib-gl_generato r -L E:\Games\rust-doom\target\release\deps -L E:\Games\rust-doom\target\release \deps --extern xml=E:\Games\rust-doom\target\release\deps/libxml-759dae9327f1df3 d.rlib --extern khronos_api=E:\Games\rust-doom\target\release\deps/libkhronos_ap i-76f01477ab0f76eb.rlib
error: linking with gcc failed: exit code: 1
note: gcc '-m64' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw3
2\lib' '-o' 'E:\Games\rust-doom\target\release\deps\gl_generator-cda8351b0c2935a
f.dll' 'E:\Games\rust-doom\target\release\deps\gl_generator-cda8351b0c2935af.o'
'-Wl,--whole-archive' '-lmorestack' '-Wl,--no-whole-archive' 'E:\Games\rust-doom
\target\release\deps\gl_generator-cda8351b0c2935af.metadata.o' '-fno-lto' '-fno-
use-linker-plugin' '-static-libgcc' '-Wl,--enable-long-section-names' '-Wl,--nxc
ompat' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-l
rustc-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32
\lib' '-lflate-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w6
4-mingw32\lib' '-lgetopts-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustli
b\x86_64-w64-mingw32\lib' '-lrbml-4e7c5e5c' 'E:\Games\rust-doom\target\release\d
eps\libkhronos_api-76f01477ab0f76eb.rlib' '-L' 'C:\Program Files (x86)\Rust\bin
rustlib\x86_64-w64-mingw32\lib' '-lrustc_llvm-4e7c5e5c' 'E:\Games\rust-doom\targ
et\release\deps\libxml-759dae9327f1df3d.rlib' '-L' 'C:\Program Files (x86)\Rust
bin\rustlib\x86_64-w64-mingw32\lib' '-ltime-4e7c5e5c' '-L' 'C:\Program Files (x8
6)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-lgraphviz-4e7c5e5c' '-L' 'C:\Progr
am Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-lrustc_back-4e7c5e5c'
'-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-lsyntax-
4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib'
'-lfmt_macros-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64
-mingw32\lib' '-larena-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x
86_64-w64-mingw32\lib' '-lserialize-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust
bin\rustlib\x86_64-w64-mingw32\lib' '-ldebug-4e7c5e5c' '-L' 'C:\Program Files (x
86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-lterm-4e7c5e5c' '-L' 'C:\Program
Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-llog-4e7c5e5c' '-L' 'C:\P
rogram Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-lregex-4e7c5e5c' '
-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-lstd-4e7c
5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\lib' '-ls
ync-4e7c5e5c' '-L' 'C:\Program Files (x86)\Rust\bin\rustlib\x86_64-w64-mingw32\l
ib' '-lrustrt-4e7c5e5c' '-L' 'E:\Games\rust-doom\target\release\deps' '-L' 'E:\G
ames\rust-doom\target\release\deps' '-L' 'C:\Users\yuv.cargo\git\checkouts\gl-r
s-5020f97825182d66\master\src\gl_generator.rust' '-L' 'C:\Users\yuv.cargo\git
checkouts\gl-rs-5020f97825182d66\master\src\gl_generator' '-Wl,--whole-archive'
'-Wl,-Bstatic' '-Wl,--no-whole-archive' '-Wl,-Bdynamic' '-lshell32' '-lpsapi' '-
limagehlp' '-lm' '-lstdc++' '-lkernel32' '-shared' '-lcompiler-rt'
note: E:\Games\rust-doom\target\release\deps\gl_generator-cda8351b0c2935af.o: fi
le not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status

error: aborting due to previous error
Could not compile gl_generator.

Caused by:
Process didn't exit successfully: rustc lib.rs --crate-name gl_generator --cr ate-type dylib --opt-level 3 --cfg ndebug -C metadata=cda8351b0c2935af -C extra- filename=-cda8351b0c2935af --out-dir E:\Games\rust-doom\target\release\deps --de p-info E:\Games\rust-doom\target\release\.fingerprint\gl_generator-cda8351b0c293 5af\dep-lib-gl_generator -L E:\Games\rust-doom\target\release\deps -L E:\Games\r ust-doom\target\release\deps --extern xml=E:\Games\rust-doom\target\release\deps /libxml-759dae9327f1df3d.rlib --extern khronos_api=E:\Games\rust-doom\target\rel ease\deps/libkhronos_api-76f01477ab0f76eb.rlib -Awarnings (status=101)

Thanks for filing this! The gl_generator module of the gl-rs dependency seems to fail to build...

The

E:\Games\rust-doom\target\release\deps\gl_generator-cda8351b0c2935af.o: file not recognized: File format not recognized

sounds weird, like the object file is corrupted or something. If cargo clean, then cargo build still doesn't work, I suggest filing an issue at their repo.

Clean then build didn't work. Brilliant github pointed out the issue I opened there. Thank you for the quick response.

Just referencing the issue over there brendanzab/gl-rs#190 to keep track of the problem.