duan47676379 2018-11-19 17:52
浏览 150

导入sqlite3驱动程序时出现问题

So I have been trying to integrate the following sqlite3 driver into my Go project; https://github.com/mattn/go-sqlite3, using the commands;

go get github.com/mattn/go-sqlite3 && go install github.com/mattn/go-sqlite3

as instructed in the readme file. Unfortunately with no success whatsoever - after running the commands and trying to import the driver using import("github.com/mattn/go-sqlite3") I am left with two very little specific errors, which I assume are related to the gcc compiler?

# command-line-arguments
/usr/bin/ld: $WORK/b001/_pkg1_.a(_x009.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
//usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Here is the output of go env, I have got both sqlite3 and GCC installed;

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/maciej/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/maciej/go"
GORACE=""
GOROOT="/usr"
GOTMPDIR=""
GOTOOLDIR="/usr/libexec/gcc/x86_64-redhat-linux/8"
GCCGO="/usr/bin/gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build343666347=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

sqlite3 -version
3.22.0 2018-01-22 18:45:57
gcc version 8.2.1 20181105 (Red Hat 8.2.1-5) (GCC)

Out of curiosity I tried running exactly the same procedure on Windows 10 using TDM gcc 5.1.0 and it worked flawlessly, I'll be really thankful for any advice regarding my problem, thank you.

  • 写回答

1条回答 默认 最新

  • dtgr6303 2019-02-22 17:32
    关注

    I had the same problem when using gobuffalo. The way how to fix this:

    Step 1: Go to following page: http://tdm-gcc.tdragon.net/

    Step 2: Download the TDM64 bundle

    Step 3: Start the TDM64 bundle and the installer opens

    I wrote a blog post about that: https://blog.gobuffalo.io/install-buffalo-on-windows-10-e08b3aa304a3

    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源