Ego2014916001--golang Development environment (support cross-compilation environment)

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

This article describes the development of the go language under Windows Environment. Implement programs that can compile windows-386, linux-386, linux-arm platforms. There are three cases that I have personally tested and passed.

Get installation software that can be installed directly under Windows

  • http://download.csdn.net/detail/seek_0380/7924665
  • http://download.csdn.net/detail/seek_0380/7924689
  • HTTP://DOWNLOAD.CSDN.NET/DETAIL/SEEK_0380/7924631 

above three download links are Go's Windows compiler, go Cross compiler, go IDE


/blockquote>

Installation

Click the Software installation separately, note that the go Windows Cross compiler installation directory must be remembered, after the use of click MinGW Select Install MINGW-GCC.

Configuration

download batch file, go install directory below src, click Execute, will install cross compiler to bin below. The download address is: http://download.csdn.net/detail/seek_0380/7924913

Open the IDE interface, set up the development environment, there is a gray button in the middle of the interface, drop-down select Win32, click the Gray button, will display an editing interface, the following settings:
Goroot=c:\go     //go The directory where the compiler is located, and also the installation directory
Gobin=f:\google\go\gowork\//Where executable files are generated
Hardware architecture of goarch=386//system
Software OS for goos=windows//systems
cgo_enabled=1//Support C
path=c:\mingw32\bin;%goroot%;%path%

Test

Create a new "package", different from the previous project, select Gopath,gopath is the working path, and the source is the path to store. You can then view the last item in the tab and add one yourself. Select a go source file, then the source of Hello World. Click Compile, execute, will appear in the following compilation debug box in the results of the run. At this point, the test is complete.
Note: In this case seems to set a lot of things, in fact, we just need to know that a program in any language written, as a high-level language requires a language interpreter, that is, compilers, compiled into our platform needs executable files. The purpose of using MINGW-GCC is to compile executable code on other platforms. By configuring the IDE's environment, the IDE chooses a different compiler to compile, the specific project how to build, where the files are placed, and slowly experience.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.