使用glfw-rs时,gcc.exe找不到-lglfw3

我在Windows上运行Rust(可能是我的第一个错误,但我不会放弃)。 我下载了64位的一切,当我build立我的项目,我得到

error: linking with `gcc` failed: exit code: 1 note: gcc '-Wl,--enable-long-section-names' '-fno-use-linker-plugin' '-Wl,--nxcompat' '-static-libgcc' '-m64' '-L' 'C:\R ust\bin\rustlib\x86_64-pc-windows-gnu\lib' '-o' 'C:\Users\jay\projects\hello_world\target\hello_world.exe' 'C:\Users\jay \projects\hello_world\target\hello_world.o' '-Wl,--gc-sections' 'C:\Users\jay\projects\hello_world\target\deps\libglfw-5 007f9fddc425da6.rlib' 'C:\Users\jay\projects\hello_world\target\deps\libbitflags-57b03d5337bba57b.rlib' 'C:\Users\jay\pr ojects\hello_world\target\deps\libsemver-693b3d5412b8e4b9.rlib' 'C:\Users\jay\projects\hello_world\target\deps\liblog-4e 79c2d7625e8c6f.rlib' 'C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-4e7c5e5c.rlib' 'C:\Rust\bin\rustlib\x86_64-pc -windows-gnu\lib\libcollections-4e7c5e5c.rlib' 'C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libunicode-4e7c5e5c.rlib' 'C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\librand-4e7c5e5c.rlib' 'C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\lib alloc-4e7c5e5c.rlib' 'C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\liblibc-4e7c5e5c.rlib' 'C:\Rust\bin\rustlib\x86_64-p c-windows-gnu\lib\libcore-4e7c5e5c.rlib' '-L' 'C:\Users\jay\projects\hello_world\target' '-L' 'C:\Users\jay\projects\hel lo_world\target\deps' '-L' 'C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib' '-L' 'C:\Users\jay\projects\hello_world\.rust \bin\x86_64-pc-windows-gnu' '-L' 'C:\Users\jay\projects\hello_world\bin\x86_64-pc-windows-gnu' '-Wl,--whole-archive' '-W l,-Bstatic' '-Wl,--no-whole-archive' '-Wl,-Bdynamic' '-lglfw3' '-lopengl32' '-lgdi32' '-lws2_32' '-lcompiler-rt' note: ld: cannot find -lglfw3 error: aborting due to previous error Could not compile `hello_world`. 

(试图格式化,但..?)

我相信问题是我的gcc.exe,它说,无论我什么时候运行它都找不到input文件。 有没有一个gcc.exe我可以取代它?

尝试下载预编译的GLFW库 。 我将lib-mingw目录中的文件复制到Rust项目中。 在我的32位Windows VM上,我把它们放在hello-glfw\bin\i686-pc-windows-gnu ,但它看起来像是你想要的hello_world\bin\x86_64-pc-windows-gnu 。 这让我可以从glfw-rs自述文件中运行这个例子 。