故障现象:
D:\Goprj\work\src\token-server>go run src/main.go
# github.com/mattn/go-sqlite3
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
感觉go-sqlite3要编译生成windows对接的lib才能运行。
这是编译工具不匹配报警。
下载一个mingw64。设置环境变量path后。Cmd进入命令行,查看一下gcc版本号。
C:\ >gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=D:/program/mingw-w64/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-10.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-min
e-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --di
n='Rev3, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-boot-ldflags=
t\ -Wl,--stack,12582912'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Rev3, Built by MSYS2 project)
这说明路径设置正确了。然后再执行工具,go run src/main.go就可以了。