Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking with link.exe failed: exit code: 1181 #23

Open
royokello opened this issue Apr 2, 2023 · 2 comments
Open

linking with link.exe failed: exit code: 1181 #23

royokello opened this issue Apr 2, 2023 · 2 comments

Comments

@royokello
Copy link

royokello commented Apr 2, 2023

Including library as a dependency causes the error in title with additional message "LINK : fatal error LNK1181: cannot open input file 'gmp.lib'"

@ienlaw
Copy link

ienlaw commented Aug 19, 2023

我在Windows上遇见这个问题并成功修复,步骤大致如下
下载gmp头文件放到磁盘某个地方
编辑classgroup\Cargo.toml 文件
在[package]添加 build = "build.rs"
新建 build.rs :

fn main() { 
    //将rustc-link-search设定为我们自己实际的C库路径就好。 
    println!(r"cargo:rustc-link-search=你的gmp.lib路径"); 
}

重新运行 cargo install --path=vdf-cli
不出意外应该编译成功并安装成功
接下来将gmp头文件中提供的gmp.dll复制到程序所在目录
cargo install安装路径是C:\Users\用户名.cargo\bin

@royokello
Copy link
Author

Thanks ... will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants