go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

gcc issue on windows 64

Open arulrajalivi opened this issue 11 years ago • 28 comments

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

arulrajalivi avatar Jun 25 '15 14:06 arulrajalivi

please type where gcc in your cmd.exe

mattn avatar Jun 25 '15 15:06 mattn

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

arulrajalivi avatar Jun 25 '15 17:06 arulrajalivi

you need to install mingw not cygwin.

mattn avatar Jun 25 '15 17:06 mattn

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

arulrajalivi avatar Jun 25 '15 17:06 arulrajalivi

Does this mean mingw-w64 is the only option to build go-sqlite on 64-bit systems? Can we do something about that?

cfstras avatar Aug 12 '15 16:08 cfstras

AFAICS, @arulrajalivi 's compiler doesn't support 64bit.

mattn avatar Aug 12 '15 23:08 mattn

The default MinGW builds don't support 64bit, and on cygwin(64), go-sqlite doesn't link.

cfstras avatar Aug 16 '15 10:08 cfstras

I use msys2 64 bit. I met the same problem. How to resolve it ?

benluo avatar Sep 06 '15 03:09 benluo

don't use msys2 to build go app. msys2 rewrite $PATH with slash separators.

mattn avatar Sep 06 '15 12:09 mattn

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

rusco avatar Sep 30 '15 10:09 rusco

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 avatar Nov 26 '15 09:11 Yggdrasill1989

@Yggdrasill1989 it's not issue of go-sqlite3.

mattn avatar Nov 26 '15 09:11 mattn

@Yggdrasill1989: Big firewall ? ultrasurf is your friend !

rusco avatar Nov 26 '15 10:11 rusco

Thanks for your answers. There's some problem about link to https, and I change to ssh link clone the project, it worked.

Yggdrasill1989 avatar Nov 27 '15 08:11 Yggdrasill1989

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.

jhvst avatar Dec 19 '15 19:12 jhvst

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

SinghBasant avatar Jan 14 '16 13:01 SinghBasant

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 avatar Jan 14 '16 14:01 mattn

@mattn Thanks for a response. Unfortunately, I didn't understand your response. Please elaborate. For info. I'm on Windows 10 Home (64 bit).

SinghBasant avatar Jan 14 '16 16:01 SinghBasant

gcc -c code\sqlite3-binding.c

if your compiler works correctly, this command should work well.

mattn avatar Jan 14 '16 17:01 mattn

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

AlekseyMartynov avatar Jul 05 '16 20:07 AlekseyMartynov