Liteide cross-compiling under Windows platform Golang

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed. Summary: The Windows platform uses Liteide to compile Golang programs for *.exe executables, but we sometimes need to compile executable programs under Linux, we load cross-compilation options under Liteide, compile error go build Runtime: LINUX/AMD64 must be bootstrapped using Make.bat, how do we solve this problem?

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:

SetCgo_enabled=0::::--:::::::::--::-:::---:: x86:::::--:::---::::SetGoarch=386SetGoos=windowsPagerMake.bat--no-cleanSetGoos=linuxPagerMake.bat--no-clean::SetGOOS=FREEBSD::PagerMake.bat--no-clean::SetGoos=darwin::PagerMake.bat--no-clean::::::::::-::-:---:-::-----:-:::---:--:::-::-:::-::-:::::,:::::::-::::::::----------:::------::::: x64::: :::::::::::::::::SetGoarch=amd64SetGoos=linuxPagerMake.bat--no-clean::SetGOOS=FREEBSD::PagerMake.bat--no-clean::SetGoos=darwin::PagerMake.bat--no-clean::::::::::-::-:---:-::-----:-:::---:--:::-::-:::-::-:::::,::::::::::::::::--:.:::-------::-------:::-. :::::::::::::::::::SetGoarch=arm::SetGoos=linux::PagerMake.bat--no-clean:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::InstallGocode::::::::::::.:::::::::::.SetGoarch=386SetGoos=windowsGoGetGithub.com/nsf/gocodepause

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)

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.