gpt4 book ai didi

rust - 无法找到 gl crate

转载 作者:行者123 更新时间:2023-11-29 08:34:00 33 4
gpt4 key购买 nike

我正在按照 here 中的说明进行操作.在示例文件夹中,我使用 first例子。出于某种原因,控制台说它找不到外部 crate “gl”。这是我的 Cargo.toml 的样子。

[package]

name = "hello_world"
version = "0.0.1"
authors = [ "bob <bobbuilder@gmail.com>" ]



[dependencies.gl]
git = "https://github.com/bjz/gl-rs"

[dependencies.glfw]
git = "https://github.com/bjz/glfw-rs.git"

[build-dependencies]
gl_generator = "*"

[dependencies]
gl_common = "*"

[[bin]]

name = "hello_world"

我的构建.rs

extern crate gl_generator;    // <-- this is your build dependency
extern crate khronos_api; // included by gl_generator

use std::os;
use std::io::File;

fn main() {
let dest = Path::new(os::getenv("OUT_DIR").unwrap());

let mut file = File::create(&dest.join("gl_bindings.rs")).unwrap();

// This generates bindsings for OpenGL ES v3.1
gl_generator::generate_bindings(gl_generator::GlobalGenerator,
gl_generator::registry::Ns::Gles2,
khronos_api::GL_XML,
vec![],
"3.1", "core", &mut file).unwrap();
}

最佳答案

您链接到的文档说:

Under the [package] section, add build = "build.rs"

但我在您的 Cargo.toml 中没有看到。

关于rust - 无法找到 gl crate ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28122233/

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