Windows系统 qitmeer-miner 编译及环境准备指导

通用环境要求(附安装链接)

  1. Git 安装
  2. Go 版本 >= 1.12 //可能需要vpn
  3. Rust/Cargo >= 1.38.0

特殊环境要求 for windows

安装 Build Tools for Visual Studio

安装过程中选择【 c++生成工具集】,如下图:

build 编译

  1. Get Source code 克隆代码到本地:

git clone git@github.com:Qitmeer/qitmeer-miner.git 或者git clone https://github.com/Qitmeer/qitmeer-miner.git

  1. Build the curkoo library 构建 cuckoo 库
$ cd qitmeer-miner  //打开 文件夹 qitmeer-miner
$ cd lib/cuckoo  //打开文件目录 lib/cuckoo
$ cargo build --release  //执行该命令构建 cuckoo 库

image

  1. Build qitmeer-miner 构建qitmeer-miner
$ cd ..\..   //目录回退两层,回到qitmeer-miner文件价目录下
$ go build  //执行go build命令构建qitmeer-miner
  1. Verify Build OK 确认编译是否成功
$ ./qitmeer-miner --version

注:若版本查看报错,[Error] unknown flag version’ `,可以试试 ./qitmeer-miner --h 查看是否出现帮助信息页。

Windows附加步骤

在执行第3步前,即 执行go build命令前,需先做下面这一步:

$ copy lib/cuckoo/target/release/cuckoo.dll to C:/Windows

手动复制文件目录:lib/cuckoo/target/release/ 下的文件 cuckoo.dll 到 C盘目录 C:/Windows文件夹中,否则go build不成功,会报如下错误:

image

从目前的观察来看,qitmeer-miner的编译方式又发生了改变 :rofl:

if you compile qitmeer-miner on windows, you also need prepare the running environment below:

set windows env, add the path of mingw64\bin into the system PATH variable,maybe like this:mingw64-evn