亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這些 Go 構建標志是什么意思?netgo -extldflag

這些 Go 構建標志是什么意思?netgo -extldflag

Go
蝴蝶刀刀 2022-01-17 10:49:54
我目前正在學習微服務在線課程,我將小型 Go 應用程序部署到 docker 容器。用于構建二進制文件的長而丑陋的命令行是這樣的:go build --tags netgo --ldflags '-extldflags "-lm -lstdc++ -static"'到目前為止,我只是用來go install編譯我的 go 應用程序。誰能向我解釋這個命令?
查看完整描述

1 回答

?
慕標5832272

TA貢獻1966條經驗 獲得超4個贊

--tags netgo 用于使用 go lang 網絡棧


--ldflags設置傳遞給“go tool link”的標志


args 到 ldflags 的值在go tool 鏈接幫助中有說明


-extldflags flags

    Set space-separated flags to pass to the external linker.

在這種情況下,外部鏈接器是“ld”,因此您可以閱讀它的手冊頁

每個參數的含義是:


-lm enables linking of the standard math library

-lstdc++ enables linking of the standard c++ library

-static means do not link against shared libraries


查看完整回答
反對 回復 2022-01-17
  • 1 回答
  • 0 關注
  • 548 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號