New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc issue on windows 64 #214

Closed
arulrajalivi opened this Issue Jun 25, 2015 · 26 comments

Comments

Projects
None yet
@arulrajalivi
Copy link

arulrajalivi commented Jun 25, 2015

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Jun 25, 2015

please type where gcc in your cmd.exe

@arulrajalivi

This comment has been minimized.

Copy link

arulrajalivi commented Jun 25, 2015

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Jun 25, 2015

you need to install mingw not cygwin.

@arulrajalivi

This comment has been minimized.

Copy link

arulrajalivi commented Jun 25, 2015

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

@cfstras

This comment has been minimized.

Copy link

cfstras commented Aug 12, 2015

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Aug 12, 2015

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

@cfstras

This comment has been minimized.

Copy link

cfstras commented Aug 16, 2015

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

@benluo

This comment has been minimized.

Copy link

benluo commented Sep 6, 2015

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Sep 6, 2015

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

@rusco

This comment has been minimized.

Copy link

rusco commented Sep 30, 2015

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

@Yggdrasill1989

This comment has been minimized.

Copy link

Yggdrasill1989 commented Nov 26, 2015

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Nov 26, 2015

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

@rusco

This comment has been minimized.

Copy link

rusco commented Nov 26, 2015

@Yggdrasill1989: Big firewall ? ultrasurf is your friend !

@Yggdrasill1989

This comment has been minimized.

Copy link

Yggdrasill1989 commented Nov 27, 2015

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

@toldjuuso

This comment has been minimized.

Copy link

toldjuuso commented Dec 19, 2015

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.

@SinghBasant

This comment has been minimized.

Copy link

SinghBasant commented Jan 14, 2016

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Jan 14, 2016

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
@SinghBasant

This comment has been minimized.

Copy link

SinghBasant commented Jan 14, 2016

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

@mattn

This comment has been minimized.

Copy link
Owner

mattn commented Jan 14, 2016

gcc -c code\sqlite3-binding.c

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

@AlekseyMartynov

This comment has been minimized.

Copy link

AlekseyMartynov commented Jul 5, 2016

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
@ifnu

This comment has been minimized.

Copy link

ifnu commented Sep 4, 2016

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

@wangwanqiang

This comment has been minimized.

Copy link

wangwanqiang commented Sep 6, 2016

I got the same problem on win10 64bit.

@tmack8080

This comment has been minimized.

Copy link

tmack8080 commented Oct 12, 2016

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%

@rusco

This comment has been minimized.

Copy link

rusco commented Oct 12, 2016

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

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

@mcappleman

This comment has been minimized.

Copy link

mcappleman commented Oct 13, 2016

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

@dougpuob

This comment has been minimized.

Copy link

dougpuob commented May 1, 2017

@rusco, thank you ! it works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment