liteide icon indicating copy to clipboard operation
liteide copied to clipboard

如何减小编译后二进制文件的大小?

Open worm001 opened this issue 1 year ago • 0 comments

What version of LiteIDE are you using (LiteIDE About - Version and Build Qt Version)?

liteidex38.3 win64 qt5.15.2

What version of Go are you using (go version)?

go1.20.11.windows-amd64.msi

What operating system and processor architecture are you using(go env)?

Windows 10 企业版ltsc

GOROOT=%PROGRAMFILES%\Go #GOBIN= GOARCH=amd64 GOOS=windows CGO_ENABLED=1 PATH=c:\mingw64\bin;%GOROOT%\bin;%PATH% LITEIDE_GDB=gdb64 LITEIDE_MAKE=mingw32-make LITEIDE_TERM=%COMSPEC% LITEIDE_TERMARGS= LITEIDE_EXEC=%COMSPEC% LITEIDE_EXECOPT=/C

菜鸟一个,在编译github上的frp-0.38.0的源代码时,发现一个问题,先安装好go1.20.11.windows-amd64.msi,然后直接运行liteide主程序(C:\liteide\bin\liteide.exe),选择win64平台,并在选项的Golangpackage处设置好goproxy。打开源码目录找到main.go(C:\frp-0.38.0\cmd\frpc\目录下),用liteide打开这个文件直接Build,会在C:\frp-0.38.0\cmd\frpc目录下生成需要的frpc.exe,但是这个文件体积有14.7MB,而github上原作者编译好的二进制文件只有9.99MB,差别很大!请问我应该如何做可以达到或者接近原作者编译的文件大小?

worm001 avatar Nov 30 '23 12:11 worm001