On windows you may got the gcc compiler error while trying to add packages like “gorm.io/driver/sqlite” in Golang. The cause for the error is that, underlying package require the gcc C compiler which is not installed on Windows PC by default.
How to solve
We need to install the C compiler on Windows machine and also need to add the path to environment variable.
The easiest way to install the mingw package from tmd-gcc repository.
Also add the path to the bin folder as follows in environment variables.
C:\TDM-GCC-64\bin
- How to add packages in Golang
- Create REST API using gin in Golang
- How to Containerize Golang app with Docker
- How to create API using mux in Golang
- How to create API using gin in Golang
- How to create API using Fiber in Golang
- Set up golang project
- How to use GORM packages in Golang
- How to solve gcc error in Golang -Windows