Hi, I'm getting started with Bevy and was trying some of its examples. I was using Windows MSVC. I copied the example code of rect.rs, then added [dependencies]bevy = { version = "0.7.0", features = ["dynamic"] } to cargo.toml, then cargo r. However after a long compilation of 260 crates, it finally showed such a error:
error: linking with `link.exe` failed: exit code: 1189
|
...
= note: LINK : fatal error LNK1189: library limit of 65535 objects exceeded
If I use cargo r --release, it shows:
thread 'main' panicked at 'Unable to find a GPU! Make sure you have installed required drivers!'
I wonder if the limits to the number of the libraries make the compilation incomplete? Is there any approaches to fix it?
I'm not familiar with bevy, but this sounds like you are running up against a limitation in the MSVC linker. You can switch to using the LLVM linker by creating .cargo/config.toml and adding this to it:
Thank you! The compilation works, but run fails.
the error from cargo r tells no much:
error: process didn't exit successfully: `target\debug\breakout.exe` (exit code:
0xc000007b)
If I directly click on the excutable, it would say, bevy_dylib-e09dc446b22a1a38.dll was missing, so I found one in target//debug//deps and copied into target//debug. But it would then say, std-13da5b615652700a.dll was missing, and this time it was no where to be found.
What was truly missing in the whole process? I' ve read the begining part of the bevy book but did not found any information about it.
Cargo extends the dynamic library search path (on windows this is the same as the executable search path, that is PATH) with the target/debug/deps dir and rustup extends it with the dynamic library directory of rustc itself. (the output of rustc --print sysroot extended by /lib on unix or /bin on windows.) This later location is where std.dll can be found. You can also use rustup run stable target/debug/breakout.exe for std.dll.
A quick search seems to indicate that this exit code means that either the executable is corrupt or it is missing a dll.
in .cargo//config.
There were lots of ppl encontering this problem, but in my case this seems not so easy to solve. I would try to seek of another engine instead.
Thank you again!
You should probably just disable the dynamic feature of bevy. It seems like it just doesn't work correctly on windows due to windows toolchain limitations.
I had been trying without it from the start, and the error just showed up. But now I've switch to Windows 10 (previously, Win 7) and all was fine! The config was just as in the file config_fast_builds. Strange, isn't it? I will try to figure out what was wrong with my environment in Windows 7.