go語言的aix系統(tǒng)編譯 go語言編譯器是什么語言開發(fā)的

windows 怎么編譯 go語言

1、解壓壓縮包到go工作目錄,如解壓到E:\opensource\go\go,解壓后的目錄結(jié)構(gòu)如下:

資中網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)公司!從網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、自適應(yīng)網(wǎng)站建設(shè)等網(wǎng)站項目制作,到程序開發(fā),運營維護。成都創(chuàng)新互聯(lián)公司2013年開創(chuàng)至今到現(xiàn)在10年的時間,我們擁有了豐富的建站經(jīng)驗和運維經(jīng)驗,來保證我們的工作的順利進行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)公司。

E:\opensource\go\go

├─api

├─bin

│ ├─go.exe

│ ├─godoc.exe

│ └─gofmt.exe

├─doc

├─include

├─lib

├─misc

├─pkg

├─src

└─test

2、增加環(huán)境變量GOROOT,取值為上面的go工作目錄

3、Path環(huán)境變量中添加";%GOROOT%\bin",以便能夠直接調(diào)用go命令來編譯go代碼,至此go編譯環(huán)境就配置好了

注:如果不想手動設(shè)置系統(tǒng)環(huán)境變量,也可下載go啟動環(huán)境批處理附件,

修改goenv.bat文件中的GOROOT值為上面的go工作目錄后直接雙擊該bat文件,go編譯環(huán)境變量即設(shè)置完成。

4、測試go編譯環(huán)境,啟動一個cmd窗口,直接輸入go,看到下面的提示就是搭建成功了

E:\opensource\go\gogo

Go is a tool for managing Go source code.

Usage:

go command [arguments]

The commands are:

build compile packages and dependencies

clean remove object files

doc run godoc on package sources

env print Go environment information

fix run go tool fix on packages

fmt run gofmt on package sources

get download and install packages and dependencies

install compile and install packages and dependencies

list list packages

run compile and run Go program

test test packages

tool run specified go tool

version print Go version

vet run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

gopath GOPATH environment variable

packages description of package lists

remote remote import path syntax

testflag description of testing flags

testfunc description of testing functions

Use "go help [topic]" for more information about that topic.

5、編譯helloworld測試程序,go語言包中test目錄帶有helloworld.go測試程序,源碼見"附一 helloworld.go",

直接調(diào)用"go build helloworld.go"就生成了"helloworld.exe"可執(zhí)行程序,運行一下這個程序看到了我們期望的hello,wolrd。

E:\opensource\go\go\testgo build helloworld.go

E:\opensource\go\go\testhelloworld.exe

hello, world

E:\opensource\go\go\test

附一 helloworld.go

// cmpout

// Copyright 2009 The Go Authors. All rights reserved.

// Use of this source code is governed by a BSD-style

// license that can be found in the LICENSE file.

// Test that we can do page 1 of the C book.

package main

func main() {

print("hello, world\n")

}

如何在AIX系統(tǒng)下編譯c或c++源文件,具體說明一下。謝謝各位高手。

用vi test.c編輯一個測試文件,如:

#include stdio.h

int main()

{

printf("Hello world!\n");

return 0;

}

然后保存退出

輸入 cc test.c其會在當前目錄生成a.out

換名mv a.out test

或者 cc -o test test.c也可

aix系統(tǒng)編譯make

換gmake試一下

gmake是GNU Make的縮寫。 Linux系統(tǒng)環(huán)境下的make就是GNU Make,之所以有g(shù)make,是因為在別的平臺上,make一般被占用,GNU make只好叫g(shù)make了。 比如在安裝二進制文件進行編譯時要使用make命令,但如果在Solaris或其他非GNU系統(tǒng)中運行,必須使用GNU make,而不是使用系統(tǒng)自帶的make版本,這時要用gmake代替make進行編譯

文章標題:go語言的aix系統(tǒng)編譯 go語言編譯器是什么語言開發(fā)的
網(wǎng)址分享:http://www.muchs.cn/article10/dohsdgo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、服務(wù)器托管企業(yè)網(wǎng)站制作、面包屑導(dǎo)航外貿(mào)建站、網(wǎng)站改版

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管