-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The PostgreSQL engine requires cgo. Please set CGO_ENABLED=1 #2149
Comments
i uninstall the Go install, and use only the snapd one, and worked like a charm |
Was having the same issue. Installed homebrew for linux, then ran |
@m1ker1n Can you give us a bit more information about the Go installation you're using? I'm confused because |
Same error here using windows WSL2 ubuntu 22.04 |
same issue WSL ubuntu 22.04 my go env VGO_ENABLED=1 |
anyone found a workaround for this? |
For anyone around here using WSL. I tried the command with |
Switch to docker version 🙌. Easy |
Yeah, for anyone encountering this issue, instead of running go install, just download the binary directly. Works for me |
I encountered this issue on WSL and ChromeOS linux environment. I was able to reproduce it here are some logs:
I also installed couple of libraries like build-essential and libc-dev before I recreated the issue not sure if it made a difference. |
It's simple to fix, first you enable CGO
then you install gcc
last you install sqlc again
|
/This problem will occur if you use go install to download. I uninstalled the original one and installed it using brew and it was no problem. |
Version
1.17.2
What happened?
sqlc was installed by this:
Used
As result got messages that I should set CGO_ENABLED=1.
Expected to generate go code.
Relevant log output
Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
No response
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: