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)