< >
    首页

    go语言在ubuntu linux上配置win32交叉编译环境

    简单记录一下软件环境的配置:

    一、安装mingw64

    二、编写编译脚本

    1、命令行程序编译脚本gowin32c.sh

    #!/bin/sh
    export CGO_ENABLED=1
    export GOOS=windows
    export GOARCH=386
    export CC=i686-w64-mingw32-gcc
    export CXX=i686-w64-mingw32-g++
    go build -ldflags '-s -w'
    

    2、图形窗口程序编译脚本gowin32w.sh

    #!/bin/sh
    export CGO_ENABLED=1
    export GOOS=windows
    export GOARCH=386
    export CC=i686-w64-mingw32-gcc
    export CXX=i686-w64-mingw32-g++
    go build -ldflags '-s -w -H=windowsgui'
    
    备案号:苏ICP备19034936号/ 苏ICP备19034936号-1/ 苏ICP备19034936号-2A    站长邮箱:fuhuizn@163.com   版权所有

    苏公网安备 32050702010684号

    Powered by MarkdownWeb