gcc issue on windows 64
While trying to do "go install github.com/mattn/go-sqlite3" I am getting the follwoing error. In one of the issues someone mentioned that we don't need gcc if we install go-sqlite3. Any help would be greatly appreciated.
github.com/mattn/go-sqlite3
exec: "gcc": executable file not found in %PATH%
Thanks Arul
please type where gcc in your cmd.exe
Added C:/cygwin/bin to the %PATH% and I can see gcc.exe in that location. Now I a getting the below error. when do a go build
github.com/mattn/go-sqlite3
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingwex /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingw32 collect2: error: ld returned 1 exit status
you need to install mingw not cygwin.
sure pointed it to C:/minggw/bin and getting this error:
github.com/mattn/go-sqlite3
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
Does this mean mingw-w64 is the only option to build go-sqlite on 64-bit systems? Can we do something about that?
AFAICS, @arulrajalivi 's compiler doesn't support 64bit.
The default MinGW builds don't support 64bit, and on cygwin(64), go-sqlite doesn't link.
I use msys2 64 bit. I met the same problem. How to resolve it ?
don't use msys2 to build go app. msys2 rewrite $PATH with slash separators.
I am using this version of gcc (64 bit) and go get's run fine: http://tdm-gcc.tdragon.net/
I installed TDM-GCC (64 bit), and I get some error:
fatal: unable to access 'https://github.com/mattn/go-sqlite3/': error setting certificate verify locations: CAfile: C:\Users\Yggdr\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\mingw32/usr/ssl/certs/ca-bundle.crt CApath: none package github.com/mattn/go-sqlite3: exit status 128
@Yggdrasill1989 it's not issue of go-sqlite3.
@Yggdrasill1989: Big firewall ? ultrasurf is your friend !
Thanks for your answers. There's some problem about link to https, and I change to ssh link clone the project, it worked.
Installing 64-bit TDM-GCC worked for me. Cygwin was unable to locate 64-bit gcc even though I had chosen it to be installed during cygwin installation.
Half a day & I almost did everything shared over here to get rid of this gcc issue :( I installed TDM-GCC , set the correct path. Please help. Got this error:

I wonder whether your compiler is possible to work just for simple C source code. could you please try
gcc -c code\sqlite3-binding.c
@mattn Thanks for a response. Unfortunately, I didn't understand your response. Please elaborate. For info. I'm on Windows 10 Home (64 bit).
gcc -c code\sqlite3-binding.c
if your compiler works correctly, this command should work well.
This worked for me:
- Install MSYS2 x86_64 from https://msys2.github.io/
- In MSYS2 shell:
pacman -S mingw-w64-x86_64-make mingw-w64-x86_64-gcc - Add
C:\msys64\mingw64\binandC:\msys64\usr\bintoPATH - Use
mingw32-make.exeasmake