go 中gcc 編譯問題(gcc.exe fatal error no input files compilation terminated)

問題背景

在windows 中編譯 go 的pipe時因爲pipe依賴sqlite,須要經過cgo進行編譯。出現以下異常sql

gcc.exe fatal error no input files compilation terminatedwindows

問題分析

因爲 windows中缺乏c 的編譯環境ui

解決方式

安裝gcc環境.net

下載(win64位)

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

版本

選擇最新版本便可,建議使用 Thread model: posixsqlite

配置環境變量 在path 中添加D:\Program Files\MinGw\x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0 (1)\mingw64\bin   

配置完成後,嘗試編譯,若是還出現異常,請從新啓動機器blog

重啓以後仍有問題,能夠設置c變量

變量名稱:C_INCLUDE_PATH 路徑:D:\Program Files\MinGw\x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0 (1)\mingw64\includeip

相關文章
相關標籤/搜索