tursodatabase / go-libsql

libSQL API for Go
MIT License
73 stars 9 forks source link

Unable to get it to work in WSL #7

Open ljrodriguez1 opened 7 months ago

ljrodriguez1 commented 7 months ago

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

haclark30 commented 6 months ago

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

CGO_ENABLED="1"
CGO_LDFLAGS="-ldl"
sullyTheDev commented 6 months ago

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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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
RiwEZ commented 3 months ago

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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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/go-libsql@v0.0.0-20240115151600-e17efbc849fc/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)