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.










share|improve this question


















  • 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 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















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.










share|improve this question


















  • 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 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













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.










share|improve this question













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.







go module sqlite3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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














  • 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 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








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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Feedback on college project

Futebolista

Albești (Vaslui)