go-libsql icon indicating copy to clipboard operation
go-libsql copied to clipboard

Unable to get it to work in WSL

Open ljrodriguez1 opened this issue 2 years ago • 4 comments

I have not been able to get this to run on wsl, as there are binaries for linux i thought this would work, but i been unable to get it to work, do you have any ideas on this

ljrodriguez1 avatar Dec 29 '23 16:12 ljrodriguez1

I was able to get this to run on WSL by setting the following environment variables:

CGO_ENABLED="1"
CGO_LDFLAGS="-ldl"

haclark30 avatar Jan 23 '24 03:01 haclark30

I was able to get this to run on WSL by setting the following environment variables:

CGO_ENABLED="1"
CGO_LDFLAGS="-ldl"

Even after setting this env vars i am still getting link errors which i thought -ldl would fix

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlClose':
sqlite3.c:(.text.unixDlClose+0x4): undefined reference to `dlclose'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlSym':
sqlite3.c:(.text.unixDlSym+0x7): undefined reference to `dlsym'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlOpen':
sqlite3.c:(.text.unixDlOpen+0x9): undefined reference to `dlopen'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlError':
sqlite3.c:(.text.unixDlError+0x18): undefined reference to `dlerror'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(std-6498d8891e016dca.std.3759e478f3a6c4f2-cgu.0.rcgu.o): in function `std::sys::unix::weak::fetch':
/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys/unix/weak.rs:138: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status

sullyTheDev avatar Jan 28 '24 06:01 sullyTheDev

I was able to get this to run on WSL by setting the following environment variables:

CGO_ENABLED="1"
CGO_LDFLAGS="-ldl"

Even after setting this env vars i am still getting link errors which i thought -ldl would fix

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlClose':
sqlite3.c:(.text.unixDlClose+0x4): undefined reference to `dlclose'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlSym':
sqlite3.c:(.text.unixDlSym+0x7): undefined reference to `dlsym'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlOpen':
sqlite3.c:(.text.unixDlOpen+0x9): undefined reference to `dlopen'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(sqlite3.o): in function `unixDlError':
sqlite3.c:(.text.unixDlError+0x18): undefined reference to `dlerror'
/usr/bin/ld: /home/sully/go/pkg/mod/github.com/libsql/[email protected]/lib/linux_amd64/libsql_experimental.a(std-6498d8891e016dca.std.3759e478f3a6c4f2-cgu.0.rcgu.o): in function `std::sys::unix::weak::fetch':
/rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/sys/unix/weak.rs:138: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status

Same for me too. (AMD CPU)

RiwEZ avatar Apr 25 '24 05:04 RiwEZ