golang – Compilar um projeto em Go para windows 32bits pelo ubuntu

Em um projeto em Go utilizando o package package github.com/google/gousb

Neste projeto específico, ao compilar para windows 32bits usando:

$ GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go build usb.go 

Apresenta a mensagem de erro:

/usr/bin/i686-w64-mingw32-ld: não foi possível localizar -lusb-1.0
collect2: error: ld returned 1 exit status

Já instalado:

sudo apt-get install gcc-multilib
sudo apt-get install gcc-mingw-w64
sudo apt-get install libmagickwand-dev
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libusb-1.0-0-dev:i386 libudev-dev:i386
sudo apt-get install mingw-w64
sudo apt-get install libusb-dev
sudo apt-get install libudev-dev:i386

Os:

Linux lonok-mint 5.4.0-81-generic x86_64 GNU/Linux

Go:

go version go1.17 linux/amd64

Code (usb.go):

package main

import (
    "fmt"
    "log"
    _ "strconv"

    "github.com/google/gousb"
)

func main() {

    // Initialize a new Context.
    ctx := gousb.NewContext()
    defer ctx.Close()

    // Open any device with a given VID/PID using a convenience function.
    /*
    "vendor_id": 2843,  // 0xB1B
    "product_id": 7,    // 0x7
    */

    dev, err := ctx.OpenDeviceWithVIDPID(0x0B1B, 0x0007)
    //cfg, err := dev.Config(1)
    //fmt.Println(cfg)
    _ = dev.SetAutoDetach(true)
    if err != nil {
        log.Fatalf("Could not open a device: %v", err)
    }
    defer dev.Close()

    ctx.Debug(1)

    // Claim the default interface using a convenience function.
    // The default interface is always #0 alt #0 in the currently active
    // config.
    intf, done, err := dev.DefaultInterface()
    if err != nil {
        log.Fatalf("%s.DefaultInterface(): %v", dev, err)
    }
    defer done()

    // Open an OUT endpoint.
    ep, err := intf.OutEndpoint(1)
    if err != nil {
        log.Fatalf("%s.OutEndpoint(7): %v", intf, err)
    }

    // Generate some data to write.
    data := make(()byte, 5)
    for i := range data {
        data(i) = byte(i)
    }

    // Write data to the USB device.
    numBytes, err := ep.Write(()byte("x1DVA0"))
    if numBytes != 5 {
        log.Fatalf("%s.Write((5)): only %d bytes written, returned error is %v", ep, numBytes, err)
    }
    fmt.Println("5 bytes successfully sent to the endpoint")

}