To build this project on Windows, you need to install GCC.
- Follow the instructions at MSYS2 to install GCC.
- Run the following command:
pacman -S mingw-w64-ucrt-x86_64-gcc
- This will install
gcc.exe
inC:\msys64\ucrt64\bin
. - Add
C:\msys64\ucrt64\bin
to yourPATH
environment variable. - Now you can proceed with building the project.
To enable CGO when building with Go, set the CGO_ENABLED
environment variable:
export CGO_ENABLED=1 # Unix-like OS
set CGO_ENABLED=1 # Windows (cmd)
$env:CGO_ENABLED=1 # Windows (PowerShell)
When building the project, use:
CGO_ENABLED=1 go build
On Windows, you may also need to specify the C compiler:
set CC=x86_64-w64-mingw32-gcc
CGO_ENABLED=1 go build
이 프로젝트를 Windows에서 빌드하려면 GCC를 설치해야 합니다.
- MSYS2의 안내를 따라 GCC를 설치합니다.
- 다음 명령어를 실행합니다:
pacman -S mingw-w64-ucrt-x86_64-gcc
- 이 과정이 완료되면
C:\msys64\ucrt64\bin
폴더에gcc.exe
가 설치됩니다. - 환경 변수
PATH
에C:\msys64\ucrt64\bin
을 추가합니다. - 이제 프로젝트를 빌드할 수 있습니다.
Go에서 CGO를 활성화하려면 CGO_ENABLED
환경 변수를 설정해야 합니다.
export CGO_ENABLED=1 # Unix 계열 OS
set CGO_ENABLED=1 # Windows (cmd)
$env:CGO_ENABLED=1 # Windows (PowerShell)
프로젝트 빌드시 다음 명령어를 사용합니다:
CGO_ENABLED=1 go build
Windows에서는 C 컴파일러를 지정해야 할 수도 있습니다:
set CC=x86_64-w64-mingw32-gcc
CGO_ENABLED=1 go build