Go 编译sqlite3 遇到的问题 + 加快go IDE编译速度
来源:互联网 发布:拍照赚钱软件 编辑:程序博客网 时间:2024/05/22 17:50
import {
_ "github.com/mattn/go-sqlite3"
}
1, 编译器说找不到这个 模块
终端使用 go get github.com/mattn/go-sqlite3
报错说找不到 GOPATH
所以设置GOROOT , GOPATH
windows下:
在系统属性-》高级-》系统变量:添加 GOPATH,值为 E:\GoPath
我的GOROOT变量值为E:\Go
重启终端,执行命令: go get github.com/mattn/go-sqlite32,继续编译
编译器说:cannot find package "golang.org/x/net/context"
使用 go get golang.org/x/net/context
由于限制问题,国内使用 go get 安装 golang 官方包可能会失败,报错连接超时
网上找到直接git clone下来
在 GOPATH 目录的src 目录下建立 golang.org/x ,
cd 进入x文件夹,执行
git clone https://github.com/golang/net.git
3,继续编译:
报错: exec: "gcc": executable file not found in $PATH
是因为没有安装gcc。 去http://tdm-gcc.tdragon.net/download下载一个,32位windows下载 tdm-gcc-4.8.1-3.exe,64位下载 tdm64-gcc-4.8.1-3.exe
安装了之后,要重启电脑,就能编译通过了
4,加快go IDE编译速度
每次都要编译引入了sqlite3的程序,速度很慢,需要30秒,于是
在终端执行命令:
go build -v
查看执行命令是哪些,发现每次都在编译sqlite
于是在终端执行命令:
go install -a github.com/mattn/go-sqlite3
它会将编译后的Go-1.3软件包安装到$ GOPATH/pkg 中。
再执行 go build -v
就很快,一瞬间
阅读全文
0 0
- Go 编译sqlite3 遇到的问题 + 加快go IDE编译速度
- Go 编译 build 然后run遇到的问题
- Go编译问题集锦
- 加快C++的编译速度
- 加快android的编译速度
- 加快Qt的编译速度
- Go 语言编译运行的小问题
- go遇到的问题
- 加快笔记本编译速度
- 加快Android编译速度
- android加快编译速度
- 加快Android编译速度
- 加快Android编译速度
- 加快Android编译速度
- 加快make编译速度
- AndroidStudio加快编译速度
- 加快AndroidStudio编译速度
- 加快android编译速度
- 多线程互斥锁访问算法(下)------Lamport算法(面包店算法)
- HUSTOJ(转发)
- hdu 1063 Exponentiation
- hdu 1002 A+B
- c++设计模式之桥接模式
- Go 编译sqlite3 遇到的问题 + 加快go IDE编译速度
- hdu 1753 大明A+B
- 其他类型转化成DataTable
- TortoiseSVN文件夹及文件图标不显示解决方法(转发)
- zend studio 10破解/汉化(转发)
- hdu 2553 N皇后问题
- PowerDesigner
- hdu1028 Ignatius and the Princess III
- Studio快捷键