Go-sqlite3: unable to build go-sqlite3 on windows 10

Created on 17 Jan 2019  路  10Comments  路  Source: mattn/go-sqlite3

when i use the command

go get github.com/mattn/go-sqlite3

i get error

cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

i have gcc in my system ( see screenshot below)
capture

my go env output

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\dark knight\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\DARKKN~1\AppData\Local\Temp\go-build281473903=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

Most helpful comment

please install TDM64-GCC (it's a MinGW-w64) compiler suite, easy to use

https://sourceforge.net/projects/tdm-gcc/files/TDM-GCC Installer/tdm64-gcc-5.1.0-2.exe/download

All 10 comments

check which gcc. If the gcc is located in msys2 or cygwin. You should use native C compiler instead.

FYI, which gcc is a Linux command. On Windows, the command would be where gcc.

$ which gcc
/c/MinGW/bin/gcc

I believe MinGW only supports 32-bit. You'll need to install and use MinGW-w64. Alternatively, try CGO_ENABLED=1 GOARCH=386 to make it build a 32-bit executable instead.

please install TDM64-GCC (it's a MinGW-w64) compiler suite, easy to use

https://sourceforge.net/projects/tdm-gcc/files/TDM-GCC Installer/tdm64-gcc-5.1.0-2.exe/download

1)enter to console export CC=x86_64-pc-cygwin-gcc
2) try again
It`s help me

What OS you are doing this on? What you seen? log file? go env ?

@hackertron Is this is current ? Please remove CYGWIN and use TDM suggested by @firasmdar

Issue closed; please re-open if required.

Sorry, but why you does not use classic Windows compiler bases with Visual Studio or distribute with Express package?

Go does not support msvc object files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaorongfu picture gaorongfu  路  10Comments

jeffreyantony picture jeffreyantony  路  7Comments

apertureless picture apertureless  路  4Comments

korovkin picture korovkin  路  12Comments

jacentsao picture jacentsao  路  6Comments