如直接自己編譯自己,會出現下面的錯誤:
$ cd /c/go/src
$ ./make.bat
building go cmd/dist using c:\go
go tool: no such tool "compile"
go tool: no such tool "compile"
go tool: no such tool "compile"
go tool: no such tool "compile"
go tool: no such tool "compile"
go tool: no such tool "compile"
go tool: no such tool "compile"
go tool: no such tool "compile"
檢視go env發現也沒任何錯誤:
$ go env
set goarch=amd64
set gobin=
set goexe=.exe
set gohostarch=amd64
set gohostos=windows
set goos=windows
set gopath=e:\dev\golang
set gorace=
set goroot=c:\go
set gotmpdir=
set gotooldir=c:\go\pkg\tool\windows_amd64
set gccgo=gccgo
set cc=gcc
set cxx=g++
set cgo_enabled=1
set cgo_cflags=-g -o2
set cgo_cppflags=
set cgo_cxxflags=-g -o2
set cgo_fflags=-g -o2
set cgo_ldflags=-g -o2
set pkg_config=pkg-config
懷疑是其他地方的問題。折騰了半天,後來發現gotooldir 為空使用bootstrap原始碼編譯工具鏈參考這裡的
說明
$ goos=windows goarch=amd64 ./make.bat可以看到,編譯時間已經更新:# building c bootstrap tool.
cmd/dist
# building compilers and go bootstrap tool.
e:\go\src\lib9\fmt\fltfmt.c: in function '__efgfmt':
e:\go\src\lib9\fmt\fltfmt.c:437:5: warning: this statement may fall through [-wi mplicit-fallthrough=]
if(ndigits > prec) {
^ e:\go\src\lib9\fmt\fltfmt.c:451:2: note: here
省略大部分日誌
---
installed go for windows/amd64 in e:\go
installed commands in e:\go\bin
修改goroot_bootstrap,設定為e:\go,重新編譯
$ goos=windows goarch=amd64 ./make.bat
# building c bootstrap tool.
可以看到,編譯時間已經更新:
easylzma在Win32下編譯
2.解壓c盤或d盤根目錄後 不要解在桌面上 在解開的檔案及目錄中,建乙個build目錄,再到http www.cmake.org 下乙個win32的cmake,並安裝好,安裝過程中,有個提示,一定選擇將cmake工作檔案新增到path中 3.進入到剛剛建立的build目錄,在該目錄下開乙個cmd視窗...
折騰llvm的win32編譯
lnk1107 檔案無效或損壞 無法在 0x2d8 處讀取.這是由於,在c 中,lib是鏈結時用,而dll是在編譯時用.所以編譯時不用dll,而應該用lib檔案.llvm說可以在x64機上編譯x86位,我試了幾下都不行,始終就是x64位.還是在老機子上跑.把並行設定改小點.又可以寫一篇文章了.寫我如...
win32使用OPENFILENAME瀏覽檔案視窗
使用win32 api開啟 瀏覽檔案視窗,使用openfilename結構體來實現這個功能。如下 openfilename ofn wchar szfile new wchar 512 wchar szfiletitle new wchar 512 memset ofn,0,sizeof ofn m...