前言
前段时间. 选择别人编译好的程序的时候。遇到了版本选择障碍.
例如如上几个类型. 我Mac版本的完全不知道选择哪种?
查询CPU类型
localhost:client sean$ sysctl -a |grep Core
machdep.cpu.brand_string: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
可以看到我的CPU是I5的.
其实从关于本机中也能发现.
下载错误版本后报错cannot execute binary file
localhost:go-cqhttp sean$ cd linux-i386
localhost:linux-i386 sean$ ls
go-cqhttp go-cqhttp-v0.9.29-fix2-linux-386.tar.gz
localhost:linux-i386 sean$ ./go-cqhttp
-bash: ./go-cqhttp: cannot execute binary file
如上所示. 我本来以为应该选择i386
类型的. 但是, 其实并不是. 最后Mac版本应该选择的为darwin-amd64
类型. 不知道是开发人员的失误还是环境原因.
通常报这个错误主要有2个原因:
- 权限不够.
chmod +x hellp.sh
- 环境不对. 即编译环境和运行环境不一样. 需要下载指定环境的程序.