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

    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题