go 項目編譯失敗


ubuntu@dongyang-K46CB:~/sunteng/src/dsp_masky/bin/bid$ go build server.go
# github.com/coreos/go-etcd/etcd
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:99:6: r.EncodeArrayStart undefined (type codec.encDriver has no field or method EncodeArrayStart)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:107:6: r.EncodeMapStart undefined (type codec.encDriver has no field or method EncodeMapStart)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:111:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:119:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:121:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:130:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:142:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:144:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:157:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:170:6: z.EncSendContainerState undefined (type codec.genHelperEncoder has no field or method EncSendContainerState)
/home/ubuntu/go/src/github.com/coreos/go-etcd/etcd/response.generated.go:170:6: too many errors
# dsp_masky/library/db/shm_index
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_GetLastError’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:52:對‘GetLastError’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_GetVersion’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:69:對‘GetVersion’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashDestroy’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:99:對‘HashDestroy’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashGet’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:119:對‘HashGet’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashHeadToString’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:136:對‘HashHeadToString’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashToString’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:191:對‘HashToString’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_NewHash’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:210:對‘NewHash’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_FreeHash’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:37:對‘FreeHash’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashClean’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:83:對‘HashClean’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashInit’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:150:對‘HashInit’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashRebuild’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:162:對‘HashRebuild’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_HashSet’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:176:對‘HashSet’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/hash.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_SetVersion’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:225:對‘SetVersion’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexError’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:64:對‘IndexError’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexGetTop’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:82:對‘IndexGetTop’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexInit’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:100:對‘IndexInit’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexResize’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:119:對‘IndexResize’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexUpdate’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:151:對‘IndexUpdate’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_NewIndex’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:171:對‘NewIndex’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_NextHash’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:188:對‘NextHash’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_TopHash’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:205:對‘TopHash’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_FreeIndex’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:37:對‘FreeIndex’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexClear’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:49:對‘IndexClear’未定義的引用
/tmp/go-build128556831/dsp_masky/library/db/shm_index/_obj/index.cgo2.o:在函數‘_cgo_74c72ce7a376_Cfunc_IndexSetTop’中:
/tmp/go-build/dsp_masky/library/db/shm_index/_obj/cgo-gcc-prolog:135:對‘IndexSetTop’未定義的引用
collect2: error: ld returned 1 exit status

第一部分錯誤是github.com/coreos/go-etcd/包版本不對,不能clone master,新版本有較大變動,要clone release-0.4版本

使用git克隆指定分支的代碼

第二部分錯誤是因為gcc編譯失敗,因為沒有寫權限,到gcc文件目錄下make就可以看到報錯,用root用戶先將c++文件編譯好再編譯go文件即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM