[Solved] Go Gcc Compilation Error: gcc.exe fatal error no input files compilation terminated

Background of the problem

When compiling the pipe of go in windows, because the pipe depends on SQLite, it needs to be compiled through CGO. The following exception appears

gcc.exe fatal error no input files compilation terminated

Problem analysis

Due to the lack of C compiling environment in windows

Solutions

Install GCC environment

Download (win64 bit)

https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/

Version

Select the latest version, and thread model: POSIX is recommended

Configure the environment variable and add D:: program files \ \ MinGW \ \ x86 to the path_ 64-8.1.0-release-posix-sjlj-rt_ v6-rev0 (1)\mingw64\bin

After the configuration is completed, try to compile, if there are still exceptions, please restart the machine

If there is still a problem after restart, you can set the C variable

Variable name: C_INCLUDE_Path path: D: \ “program files \” MinGW \ “x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0 (1)\mingw64\include

Similar Posts: