gpt4 book ai didi

rust - kiss3d 构建错误:特性 'core::fmt::Debug 没有为类型 Modifiers 实现

转载 作者:行者123 更新时间:2023-11-29 08:36:18 25 4
gpt4 key购买 nike

我曾尝试在 Windows 7(rust 1.0 32 位、rust nighty 1.3 32 位)下构建“kiss3d”,但没有成功。有没有人做过,而且成功了?

我使用了以下 Cargo.toml : cargo .toml(符合。: gcc.exe cannot find -lglfw3 when using glfw-rs ):

[package]
name = "kiss3d"
version = "0.1.2"
authors = [ "SĂ©bastien Crozet <developer@crozet.re>" ]

description = "3D graphics engine for Rust."
repository = "https://github.com/sebcrozet/kiss3d"
readme = "README.md"
keywords = [ "3D", "graphics", "OpenGL", "KISS" ]
license = "BSD-3-Clause"

include = [
"src/**/*.rs",
"examples/**/*.rs",
"examples/media",
"examples/Cargo.toml",
"Cargo.toml",
"LICENSE",
"Readme.md"
]
[dependencies.glfw]
git = "https://github.com/bjz/glfw-rs.git"
default-features = false

[lib]
name = "kiss3d"
path = "src/lib.rs"

[dependencies]
nalgebra = "*"
gl = "*"
time = "*"
num = "*"
libc = "*"
ncollide_procedural = "*"
freetype-rs = "*"
image = "*"

但无济于事。

最佳答案

我找到了适合我的方法(使用 Win 7 教授,rust nightly 1.4 32 位版本):

1) 我更改了 ./src 目录中的 lib.rs 添加以下行: #![功能(libc)] 行前: 外部 crate libc;

2) 我在项目的根目录下创建了 ./bin/i686-pc-windows-gnu 目录

3) 在 ./bin/i686-pc-windows-gnu 中,我复制了以下文件: freetype6.dll,glfw3.dll

4) 改变了 Cargo.toml:

 [package]
name = "kiss3d-examples"
version = "0.1.0"
authors = [ "SĂ©bastien Crozet <developer@crozet.re>" ]
[dependencies]
rand = "*"
nalgebra = "*"
gl = "*"
time = "*"
num = "*"
image = "*"
ncollide_procedural = "*"
ncollide_transformation = "*"
freetype-rs = "*"
[dependencies.glfw]
git = "https://github.com/bjz/glfw-rs.git"
default-features = false
[lib]
name = "kiss3d"
path = "./src/lib.rs"

[[bin]]
name = "cube"
path = "./cube.rs"

所以我能够:cargo run 和 cube examples runs ...

关于rust - kiss3d 构建错误:特性 'core::fmt::Debug 没有为类型 Modifiers 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31701125/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com