GoLang - 解決 gcc:exec: “gcc”: executable file not found in %PATH%
在 Windows 如果使用 Go 語言使用 sqlite3 時,會需要透過 gcd 來編譯 C ,
如果沒有安裝 gcc 就會出現以下錯誤訊息
gcc:exec: "gcc": executable file not found in %PATH%
只要前往 tdm-gcc 並且下載 (tdm64-gcc-9.2.0.exe)
安裝時,勾選自動加入 PATH 環境變量,或者安裝後手動加入 PATH
gcc -v
輸出以下訊息表示成功
Using built-in specs.
COLLECT_GCC=C:\TDM-GCC-64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/TDM-GCC-64/bin/../libexec/gcc/x86_64-w64-mingw32/9.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-git-9.2.0/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --enable-large-address-aware --disable-rpath --disable-symvers --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: posix
gcc version 9.2.0 (tdm64-1)