Go-sqlite3: gcc issue on windows 64

Created on 25 Jun 2015  路  27Comments  路  Source: mattn/go-sqlite3

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

Most helpful comment

I am using this version of gcc (64 bit) and go get's run fine:
http://tdm-gcc.tdragon.net/

All 27 comments

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:
err

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\bin and C:\msys64\usr\bin to PATH
  • Use mingw32-make.exe as make

i remove my mingw 32 bit installtion and using mingw 64 installation from souceforge site here

https://sourceforge.net/projects/mingw-w64/

i follow default installation setup and it install mingw in this folder

C:\Program Files\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\

so put C:\Program Files\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin folder in PATH directory and test with gcc command from cmd.

works like miracle

I got the same problem on win10 64bit.

I get this error on Windows 10 64-bit. The instructions state:
"if you install go-sqlite3 with go install github.com/mattn/go-sqlite3, you don't need gcc to build your app anymore."

So do I need a C compiler to use this driver?

c:\Go\workspace>go install github.com/mattn/go-sqlite3
github.com/mattn/go-sqlite3
exec: "gcc": executable file not found in %PATH%

Yes, you need a c compiler, I recomend this distribution, works fine on my windows 7/64 bit PC:

http://tdm-gcc.tdragon.net/

Use the link @rusco shared. It worked for me on Windows 10 64. Thank you @rusco!!!

@rusco, thank you ! it works :)

I found the issue:

I was build code via git bash, the PATH variable is differ from the windows system "PATH";
like building in linux, I export the PATH by export PATH="$PATH:/c/TDM-GCC-64/bin", then the build is passed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dylanlyu picture dylanlyu  路  6Comments

anacrolix picture anacrolix  路  6Comments

student020341 picture student020341  路  9Comments

barnettZQG picture barnettZQG  路  7Comments

jacentsao picture jacentsao  路  6Comments