Go issue when importing sqlite3 driver
up vote
3
down vote
favorite
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.
add a comment |
up vote
3
down vote
favorite
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
Try the following: github.com/mattn/go-sqlite3/issues/256#issuecomment-232622142
– Tim Cooper
Nov 19 at 17:58
Weirdly enough it does not seem to work.
– Maciej21592
Nov 19 at 18:02
Tangentially, you shouldn't need to run thego installcommand,go getnatively installs anything it pulls. Thego installcall should only be needed if you pulled down the repo viagit cloneor viago get -d(which tellsgo getto only download and not install).
– Kaedys
Nov 19 at 18:04
Can you try addingCGO_LDTHREADto your environment? i.e.export CGO_LDTHREAD=-lpthread
– ssemilla
Nov 20 at 5:17
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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.
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.
asked Nov 19 at 17:52
Maciej21592
59110
59110
1
Try the following: github.com/mattn/go-sqlite3/issues/256#issuecomment-232622142
– Tim Cooper
Nov 19 at 17:58
Weirdly enough it does not seem to work.
– Maciej21592
Nov 19 at 18:02
Tangentially, you shouldn't need to run thego installcommand,go getnatively installs anything it pulls. Thego installcall should only be needed if you pulled down the repo viagit cloneor viago get -d(which tellsgo getto only download and not install).
– Kaedys
Nov 19 at 18:04
Can you try addingCGO_LDTHREADto your environment? i.e.export CGO_LDTHREAD=-lpthread
– ssemilla
Nov 20 at 5:17
add a comment |
1
Try the following: github.com/mattn/go-sqlite3/issues/256#issuecomment-232622142
– Tim Cooper
Nov 19 at 17:58
Weirdly enough it does not seem to work.
– Maciej21592
Nov 19 at 18:02
Tangentially, you shouldn't need to run thego installcommand,go getnatively installs anything it pulls. Thego installcall should only be needed if you pulled down the repo viagit cloneor viago get -d(which tellsgo getto only download and not install).
– Kaedys
Nov 19 at 18:04
Can you try addingCGO_LDTHREADto your environment? i.e.export CGO_LDTHREAD=-lpthread
– ssemilla
Nov 20 at 5:17
1
1
Try the following: github.com/mattn/go-sqlite3/issues/256#issuecomment-232622142
– Tim Cooper
Nov 19 at 17:58
Try the following: github.com/mattn/go-sqlite3/issues/256#issuecomment-232622142
– Tim Cooper
Nov 19 at 17:58
Weirdly enough it does not seem to work.
– Maciej21592
Nov 19 at 18:02
Weirdly enough it does not seem to work.
– Maciej21592
Nov 19 at 18:02
Tangentially, you shouldn't need to run the
go install command, go get natively installs anything it pulls. The go install call should only be needed if you pulled down the repo via git clone or via go get -d (which tells go get to only download and not install).– Kaedys
Nov 19 at 18:04
Tangentially, you shouldn't need to run the
go install command, go get natively installs anything it pulls. The go install call should only be needed if you pulled down the repo via git clone or via go get -d (which tells go get to only download and not install).– Kaedys
Nov 19 at 18:04
Can you try adding
CGO_LDTHREAD to your environment? i.e. export CGO_LDTHREAD=-lpthread– ssemilla
Nov 20 at 5:17
Can you try adding
CGO_LDTHREAD to your environment? i.e. export CGO_LDTHREAD=-lpthread– ssemilla
Nov 20 at 5:17
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380175%2fgo-issue-when-importing-sqlite3-driver%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Try the following: github.com/mattn/go-sqlite3/issues/256#issuecomment-232622142
– Tim Cooper
Nov 19 at 17:58
Weirdly enough it does not seem to work.
– Maciej21592
Nov 19 at 18:02
Tangentially, you shouldn't need to run the
go installcommand,go getnatively installs anything it pulls. Thego installcall should only be needed if you pulled down the repo viagit cloneor viago get -d(which tellsgo getto only download and not install).– Kaedys
Nov 19 at 18:04
Can you try adding
CGO_LDTHREADto your environment? i.e.export CGO_LDTHREAD=-lpthread– ssemilla
Nov 20 at 5:17