普拉多VX

人生一路,不问来时,不知归期

0%

golang sqlite3 exec gcc executable file not found

提示没有gcc问题

windows 10

1
2
3
C:\Users\UI\go\src\ThorGui>go get
# github.com/mattn/go-sqlite3
exec: "gcc": executable file not found in %PATH%

解决方法

1.下载gcc并安装 https://jmeubank.github.io/tdm-gcc/

注意勾选,默认即可

完成安装

2.验证是否安装成功

gcc -v

1
2
3
4
5
6
7
8
9
10
C:\Users\UI>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
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)

C:\Users\UI>

3.关闭goland工程,重新打开

再次使用go get 下载安装sqlite3

参考