tomaka / hlua

Rust library to interface with Lua
MIT License
507 stars 48 forks source link

run example: (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION) #212

Closed Misaka299 closed 2 years ago

Misaka299 commented 2 years ago

cargo.toml

[package]
name = "luatest"
version = "0.1.0"
edition = "2021"
#build = "build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hlua = "0.3"

main.rs

extern crate hlua;

use hlua::Lua;

fn main() {
    let mut lua = Lua::new();
    let x: u32 = lua.execute("return 6 * 2;").unwrap();    // equals 12
    println!("ssss{}", x);
}

log

C:/Users/xm111/.cargo/bin/cargo.exe run --color=always --package luatest --bin luatest
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target\debug\luatest.exe`
error: process didn't exit successfully: `target\debug\luatest.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

Process finished with exit code -1073741819 (0xC0000005)

Why is that?

Misaka299 commented 2 years ago

There is a problem with my development environment.