`libwinpthread-1.dll` was not found
Version
1.27.0
What happened?
Running on Windows I get the libwinpthread-1.dll error. From a brief search it looks like it might be due to not having statically linked against mingw libc?
Relevant log output
Windows dialog box pops up with:
> sqlc.exe - System Error
>
> The code execution cannot proceed because libwinpthread-1.dll was not found.
> Reinstalling the program may fix this problem.
>
> [OK]
Database schema
N/A
SQL queries
N/A
Configuration
N/A
Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
I'm also experiencing this problem. (Windows 10 Pro | 64-bit)
Experiencing the same thing on Windows 11 Pro
I encountered the same issue. The installation guide also states that only a single file is needed. I will try static compilation to see if the problem is caused by inconsistent environments. system by windows 11 24H2
I encountered the same issue. The installation guide also states that only a single file is needed. I will try static compilation to see if the problem is caused by inconsistent environments. system by windows 11 24H2
I cloned and downloaded the code, changed only the Go version to 1.24.3 to keep it consistent, and then manually compiled the program. The compiled program can be opened, but I am not sure yet if this will affect any functionality. Below is the command I used for compilation:
Environment: Windows 11 24H2, PowerShell
Build command: cmd /c "set CGO_ENABLED=0&& set GOOS=windows&& set GOARCH=amd64&& go build -trimpath -ldflags=\"-s -w\"" -o sqlc.exe ./cmd/sqlc
Can people try out this build? I used Windows Server 2025, which may fix things?
sqlc_1.29.0_windows_amd64.tar.gz sqlc_1.29.0_windows_amd64.zip
On Windows Server 2019 Standard Evaluation Version 1809 it still throws the same error.
Can people try out this build? I used Windows Server 2025, which may fix things?
sqlc_1.29.0_windows_amd64.tar.gz sqlc_1.29.0_windows_amd64.zip
I tried using the version you compiled, but the same issue still occurs on both my Windows Server 2025 and Windows 11 24H2 devices. Since Git on my device is not linked to GitHub, I packaged my local code and the compiled binary file and uploaded them to the Releases section of one of my empty projects. In theory, the only change I made should be to the go.mod file.
https://github.com/2938915974/desktop-tutorial/releases/download/my-sqlc-compile/sqlc-mycompile-main_src.zip https://github.com/2938915974/desktop-tutorial/releases/download/my-sqlc-compile/sqlc_1.29.0_mycompile_windows_amd64.zip
@2938915974 I am running into this issue currently and was trying to download your new compiled binary, but the link is dead. Any chance you could provide it again?
I've recompiled without using cgo which may fix the issue. Can you try these?
- https://downloads.sqlc.dev/prerelease/sqlc_1.29.0_windows_arm64.zip
- https://downloads.sqlc.dev/prerelease/sqlc_1.29.0_windows_amd64.zip
I've recompiled without using cgo which may fix the issue. Can you try these?
- https://downloads.sqlc.dev/prerelease/sqlc_1.29.0_windows_arm64.zip
- https://downloads.sqlc.dev/prerelease/sqlc_1.29.0_windows_amd64.zip
Yes, it can start normally now!
This may be due to the fact that the Postgres dependency, pg_query_go, invokes the Windows library libwinpthread-1.dll. Although the application is able to start properly after disabling CGO, I am not yet certain whether this will cause any issues with Postgres.
When cgo is disabled, we use wazero to execute the parser instead. Everything should work 100%
When cgo is disabled, we use wazero to execute the parser instead. Everything should work 100%
Fixed in v1.30.0