-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Install without gcc (not possible) #212
Comments
go-sqlite3 is cgo package. so if you want to build app using go-sqlite3, you need gcc. |
@mattn the repository
|
once |
|
As I said in above:
|
And I answered to you in #212 (comment) We are going circles. |
@techtonik once go-sqlite3 is installed, you no longer need gcc. However, you need the compiled package in your $GOPATH/pkg to do this. To do so, you need gcc to build the C dependencies of this project. ie. You could probably compile the archive file elsewhere and put it in the $GOPATH to forego gcc. This isn't guaranteed to work, it's much easier to compile the final program and put the binary on the system with no gcc. |
@drewwells: the problem is I am able to go get the package but not able to build/install it. Its complaining about "gcc" github.com/mattn/go-sqlite3exec: "gcc": executable file not found in %PATH% |
@arulrajalivi what OS are you using? |
Windows 64 |
from cygwin if I try which gcc I get |
followed this link to install gcc : http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/ |
getting this from cygwin, so trying to see what to set in the %PATH% |
Inside a cygwin window, see what
|
$ go env |
after adding C:\MinGW\bin, I am getting # github.com/mattn/go-sqlite3 |
as the message, you need to install 64bit gcc. |
Early on mattn suggested that you could just "go install ..." but said "go-sqlite" instead of "go-sqlite3". Was this significant? Or is mattn's last comment, that you need gcc, the absolute truth? Is there a way to install this API without gcc under windows or not? |
Ah, it's my fault. |
I have the exact same the problem in windows and I do not understand how Mattm last command solved the problem? what would be the compele command for go insrall? |
go get -u github.com/mattn/go-sqlite3 |
so in windows I get "exec gcc executable %PATH%", it's the same problme you guys discussed above I just do not understand how you resolved it I can get the package but i can not create the binary because I do not have GCC. |
go-sqlite3 is cgo package, so you need to install gcc. |
So in windows, I have to install Cygwin, build the binary and put in "GOROOT/PKG", is that what you mean? |
|
|
If it helps anyone, by default, msys2's Pacman seems to install gcc into C:\msys64\mingw64\bin so you'll need to add that directory to your environment PATH variable and restart your programs before gcc will work. |
FYI, This is |
@mattn the users of this extension are developers, and they need to install it to use it first, and this is impossible without gcc. It is my understanding how Go stuff works. What do you mean by using if that's not the case? |
If you install go-sqlite3 with |
This says that go install compiles code too: I am not able to validate this claim now, because:
I guess I had enough of yak shaving for this issue. Feel free to close until better time. |
|
As I said in above, if you compile go-sqlite3.a with |
I have the same problem on ubuntu 14.04.4 LTS, I tried this: $ git clone https://github.com/mattn/go-sqlite3
Cloning into 'go-sqlite3'...
remote: Counting objects: 1112, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 1112 (delta 0), reused 0 (delta 0), pack-reused 1110
Receiving objects: 100% (1112/1112), 8.27 MiB | 4.93 MiB/s, done.
Resolving deltas: 100% (588/588), done.
Checking connectivity... done.
$ go install github.com/mattn/go-sqlite3
# github.com/mattn/go-sqlite3
exec: "gcc": executable file not found in $PATH Any suggestion? |
sudo apt-get install build-essential |
having the same problem "exec: "gcc": executable file not found in $PATH" :( |
@mitradibakar please read all of comments in above. |
Its working fine now windows thanks to @mattn and "tdm64-gcc-5.1.0-2.exe" happy coding :) |
"tdm64-gcc-5.1.0-2.exe" is the solution. |
apt-cyg install mingw64-x86_64-gcc-g++
env CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC="x86_64-w64-mingw32-gcc" \
go get github.com/mattn/go-sqlite3 In Cygwin will be fine. |
Here are the step by step instructions.
|
msaron - Thank You! |
perfect help! Thanks, everyone. |
After installing i still need gcc.
|
I would like to mention that this package really only needs a GCC in the PATH. No libraries, no special command prompts, nothing else. The problem with most CGO packages is that the README says "needs GCC", but actually means something like "needs a certain version of GCC from the 32-bit build of Mingw-w64 and also this library, which you have to compile with That is why I usually give up and use a different package when I see |
for linux > sudo apt install gcc |
I had the same problem on ubuntu: go install github.com/mattn/go-sqlite3 go get -v github.com/mattn/go-sqlite3 $sudo apt install gcc-5 then it worked |
I am using windows machine and I am getting error like github.com/mattn/go-sqlite3exec: "gcc": executable file not found in %PATH% |
Which GCC have you installed and where? |
https://jmeubank.github.io/tdm-gcc/ Is working fine on windows 10 64 |
Is it possible to use the library in Go without recompiling the binaries?lxc/incus#762 (comment)
I mean is it possible to compile binary pieces of SQLite needed be go-sqlite3 and ship them in separate repository, so that only Go itself can be used to assemble the final product together? Maybe Go already provides some helpers/tools to do that?
The text was updated successfully, but these errors were encountered: