Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
christoofar authored May 10, 2024
1 parent 609062f commit 81d2411
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ Compile your program this way:

This will statically link the lzma dependency from MSYS2 into your binary.

### Making a Windows binary from Linux/Docker

You don't need Windows to make a Windows binary if you are developing in CGo. To do this, you need the MinGW64 GCC compiler:
```
sudo apt-get install gcc-multilib
sudo apt-get install gcc-mingw-w64
```

Then to build, just pass along the env setting to use the MinGW compiler
```
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -ldflags "-extldflags \"-static\""
```

## Usage

```go
Expand Down

0 comments on commit 81d2411

Please sign in to comment.