[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


Install GCC environment

Download (win64 bit)



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: