当“makensis”二进制文件执行test.nsi时,“makensis”二进制文件必须引用Stubs目录下的“zlib-x86-ansi”文件。但它会搜索 GOROOT 目录。所以它会导致错误。我该如何解决?
GOROOT = /usr/local/go/
/root/go/src/bin/makensis
/Stubs/zlib-x86-ansi
/nsis/test.nsi
cmd := exec.Command("/root/go/src/bin/makensis","/root/go/src/nsis/test.nsi")
cmd.Dir = "/root/go/src/bin/"
var out bytes.Buffer
var stderr bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &stderr
err := cmd.Run()
if err != nil {
log.Println(fmt.Sprint(err) + ": " + stderr.String())
return err
exit status 1: Error: "/usr/local/go/src/Stubs/zlib-x86-ansi"
慕妹3146593
相关分类