-
|
Hello, Do you succeed to start your executable after building it on Windows? Let me explain (I use GoLand): I have setup my environment by applying this and using v1.4.2 -- libduckdb-windows-amd64.zip. I'm using the last version of duckdb-go (2.5.3). In debug mode, everything works fine : the database opens/is created if not exists and the life goes on. To reproduce, you can use the simple example However, after building, the executable crashes, especially at sql.Open("duckdb", pathToMyDb) call, for no apparent reason. I can't even retrieve the error: it looks like a big panic. In order to find the root cause, I have added logs step by step starting from sql.Open. And It's coming from '...\github.com\duckdb\duckdb-go-bindings\windows-amd64@v0.1.23\bindings.go' line 1081
It looks like a C issue.. or I missed something ? Do you have an idea ? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi! - We run the test suite for this package on a Windows CLI runner.
|
Beta Was this translation helpful? Give feedback.
-
|
I have only a path to my db like : "D:/mydb.duckdb". But as I said the the simple example reproduce the crash. And as I said, it works as expected in debug mode, so that's curious... |
Beta Was this translation helpful? Give feedback.
-
|
I finally got this working thanks to this hint: This is a step-by-step procedure starting from zero. It should help others on Windows. 1. Install MSYS2Download and install MSYS2 from: Follow the installer instructions and open the MSYS2 shell. 2. Update packages and install the DuckDB package for UCRT64Open an MSYS2 shell and run: # update package database and core packages
pacman -Syu
# install DuckDB for mingw-w64 ucrt x86_64
pacman -S ucrt64/mingw-w64-ucrt-x86_64-duckdbVerify the installed filesMake sure the expected DuckDB files are present:
NB: "C:/msys64" is the msys2 install folder 3. Set the environment variable and build your Go app$env:CGO_LDFLAGS = '-LC:/msys64/ucrt64/lib'
# Verify the value for this session
go env CGO_LDFLAGS
# Build your Go project
go build
# Run the produced executable
.\yourApp.exeEt voilà |
Beta Was this translation helpful? Give feedback.

I finally got this working thanks to this hint:
marcboeker#175 (comment)
This is a step-by-step procedure starting from zero. It should help others on Windows.
1. Install MSYS2
Download and install MSYS2 from:
Follow the installer instructions and open the MSYS2 shell.
2. Update packages and install the DuckDB package for UCRT64
Open an MSYS2 shell and run:
Verify the installed files
Make sure the expected DuckDB files are present:
libduckdb.dllshould be inC:/msys64/ucrt64/binlibduckdb.dll.ashould be in