Golang using Liteide for cross-platform compilation under Windows platform

Source: Internet
Author: User
Tags gocode
This is a creation in Article, where the information may have evolved or changed. 1, using cross-compilation in a Windows environment, you need to compile the tool gcc, you must use MinGW:


http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/ Mingw-get-inst-20120426.exe/download


Run MinGW installation Mannger after installation is complete






Select Install mingw32-ggc-g++


Set environment variables after installation, add C:\MinGW\bin (installation directory) to the previous position in the system environment variable path


Note: If an error such as this occurs COUNLD not being located in the dynamic link Libintl-8.dll, is this DLL conflict, will all other directories Libintl-8.dll all renamed, to prevent conflicts, remember to change back after compiling or affect the normal operation of other programs, as follows:






2, in the Golang (current version Go 1.3.3) installation directory under the C:\GO\SRC directory under the new Cc.bat file (first name), the contents are as follows:


Set Cgo_enabled=0
::::--:::::::::--::-:::---:: x86:::::--:::---::::
Set goarch=386

Set Goos=windows
Call Make.bat--no-clean

Set Goos=linux
Call Make.bat--no-clean

:: Set Goos=freebsd
:: Call Make.bat--no-clean

:: Set Goos=darwin
:: Call Make.bat--no-clean
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::-:::::: x64::::--:::-------:--::--::--------::------::-.
Set GOARCH=AMD64

Set Goos=linux
Call Make.bat--no-clean

:: Set Goos=freebsd
:: Call Make.bat--no-clean

:: Set Goos=darwin
:: Call Make.bat--no-clean
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

On:::::::::::-::--::--::::-:::::-:::::-:::::-:::::-:::::-::::--::::.::-::
:: Set Goarch=arm
:: Set Goos=linux
:: Call Make.bat--no-clean
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::: Gocode::::-----:---:------------:::-:------:.::-:::::.
Set goarch=386
Set Goos=windows
Go get Github.com/nsf/gocode
Pause
After that, double-click to run the batch file, a lengthy compilation process, no error, then congratulations on your success:)


(see if the bin directory and the PKG directory have execution files and package generation for the relevant platform)


3, open liteide x24 Select Compile Linux executable (above batch file not all platforms are compiled, executable added)






Then compile the program, found in the source file directory, the Linux executable has been successfully generated!
Related Article

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.