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=386set goos=windowscall make.bat --no-clean set goos=linuxcall make.bat -- No-clean ::set goos=freebsd::call make.bat --no-clean ::set goos=darwin::call make.bat --no-clean:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::: ::::::::::::x64:::::::::::::::::::::::::::::::::::::::set goarch=amd64set goos=linuxcall make.bat --no-clean::set goos=freebsd::call make.bat --no-clean ::set goos= Darwin::call make.bat --no-clean::::.::::::::::::::-----:-::::--:::::::-::::::::::::::::.::::::::-:::::.::: :::::::::::::::::::::::arm::::::::::::::::::::::::::::::::::::::::set goarch=arm::set goos= Linux::call make.bat --no-clean::::.::::::::::::::-----:-::::--:::::::-::::::::::::::::.::::::::-:::::.::: ::::::::::::::::::::::install gocodE::::::::::::::::::::::::::::set goarch=386set goos=windowsgo get github.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)
Then compile the program, found in the source file directory, the Linux executable has been successfully generated!