让最新版xray-core支持在Windows7下运行的方法,还在用老系统的可以试试。 #3373
Replies: 7 comments 13 replies
-
"Please don't be ambiguous. There are still people using Windows 7. You can refuse feedback about Windows 7, and you don't have to release compatible versions. But please don't prevent other users from finding ways to continue supporting Windows 7." |
Beta Was this translation helpful? Give feedback.
-
Please refer to the update log of the Go programming language for details. Use at your own risk, as this project will not accept issue reports related to compiling using this method. |
Beta Was this translation helpful? Give feedback.
-
//go:build go1.22
package xx
// ... //go:build !go1.22
package xx
// ... How about we use multiple files for different version of golang? |
Beta Was this translation helpful? Give feedback.
-
v1.8.15兼容需要修改代码
修改为:
然后正常编译即可 |
Beta Was this translation helpful? Give feedback.
-
golang v1.21.4 的 mac 单元测试会失败,所以 win7 和 mac 不可兼得。还是单独编译个 win7 版发布文件更合适。 |
Beta Was this translation helpful? Give feedback.
-
使用go1.21.4编译,Windows7也可以运行,无需修改代码。
只需修改go.mod,把开头的go 1.22改成go1.21。
然后使用以下命令更新go.mod:
go mod tidy
最后正常编译即可:
go build -o xray.exe -trimpath -ldflags "-s -w -buildid=" ./main
Beta Was this translation helpful? Give feedback.
All reactions