FiloSottile / mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.
https://mkcert.dev
BSD 3-Clause "New" or "Revised" License
48.31k stars 2.49k forks source link

Build on linux for windows faild #448

Open ruslan-gennadievich opened 2 years ago

ruslan-gennadievich commented 2 years ago

root@ddd:/tmp/mkcert# go install go: downloading golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 go: downloading software.sslmate.com/src/go-pkcs12 v0.2.0 go: downloading golang.org/x/text v0.3.7 go: downloading golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 root@ddd:/tmp/mkcert# CGO_ENABLED=0 GOOS=windows GOARACH=amd64 go build -ldflags "-s -w" -trimpath main.go ./main.go:177:4: m.loadCA undefined (type mkcert has no field or method loadCA) ./main.go:193:29: undefined: hasNSS ./main.go:193:39: undefined: CertutilInstallHelp ./main.go:193:71: m.checkNSS undefined (type mkcert has no field or method checkNSS) ./main.go:195:77: undefined: NSSBrowsers ./main.go:197:30: undefined: hasJava ./main.go:197:44: m.checkJava undefined (type mkcert has no field or method checkJava) ./main.go:207:5: m.makeCertFromCSR undefined (type mkcert has no field or method makeCertFromCSR) ./main.go:237:4: m.makeCert undefined (type mkcert has no field or method makeCert) ./main.go:272:9: m.installPlatform undefined (type mkcert has no field or method installPlatform) ./main.go:272:9: too many errors

root@ddd:/tmp/mkcert# go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/root/.cache/go-build" GOENV="/root/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/root/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/root/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.18.2" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/tmp/mkcert/go.mod" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3415286915=/tmp/go-build -gno-record-gcc-switches"

craigtao commented 2 months ago

enter the directory of mkcert source code, and then execute command: go build