-
Notifications
You must be signed in to change notification settings - Fork 126
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
Clear installation of Gosub on the Windows 10 - using msys64 #100
Comments
Suggestion to include this. How? Updated Gousb instructions for Raspberry Pi : |
I'd suggest you prepare a pull request with a file that outlines pretty much what you wrote above (a Markdown file, I just finished preparing an installation procedure in a Windows environment of Github Actions, so I have some clarifications for the above:
|
@Gustavomurta Thanks sir, Thank you so mush! You can write these instructions on GitBook with some tutorials on gousb too if you want |
@Gustavomurta I tried your solution but getting errors when install or building gousb. I attach screen shot. |
Hi Mahbubur Rahman, Test the Gousb installation by compiling and running the example lsusb: |
After countless attempts and days of research and testing, I managed to do a correct installation of Gosusb on Windows 10. If you skip the procedure, you might get lost. You can use other procedures, but this one was tested by me.
The installation procedure on Windows is very simplified. And for the beginner, it can induce errors that will make the installation of Gousb impossible.
https://github.com/google/gousb#notes-for-installation-on-windows
To help the beginner, I decided to open this problem. If there is another alternative for me to help, please let me know. I have no experience with Github. I will include a summary of the procedure. If you accept my help, I will be able to inform you in detail.
Install Libusb-1.0 Library, using msys2
How to use libusb under MinGW-w64: /ld.exe: cannot find -lusb? libusb/libusb#695 (comment)
Make sure the msys64 installation folder is: C:\msys64
Do not install elsewhere as it will have problems using the packages.
Add the mingw64 folder to the Windows 10 environment variables.
example:
Path >>> C:\msys64\mingw64\bin
Reference:
https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
Install the gcc compiler, using msys2 - run command (at MSYS prompt)
$ pacman -S mingw-w64-x86_64-gcc
Install the pkg-config, using msys2 - run command (at MSYS prompt)
$ pacman -S mingw-w64-x86_64-pkg-config
Test the Libusb installation with these commands. Make sure the folders are correct (very important).
Examples:
C:\Users\jgust>pkg-config --cflags libusb-1.0
-IC:/msys64/mingw64/include/libusb-1.0
C:\Users\jgust>pkg-config --libs libusb-1.0
-LC:/msys64/mingw64/lib -lusb-1.0
Install the Gousb package, with this command and no message of errors:
go get -v github.com/google/gousb (This procedure no longer works)
Use this procedure:
https://go.dev/ref/mod#go-install
go install github.com/google/gousb@latest
Example:
C:\Users\jgust\go>go install github.com/google/gousb@latest
package github.com/google/gousb is not a main package
https://github.com/google/gousb/tree/master/lsusb
C:\Users\jgust\go\programas\gousb\lsusb>go mod init main.go
go: creating new go.mod: module main.go
go: to add module requirements and sums:
go mod tidy
C:\Users\jgust\go\programas\gousb\lsusb>go mod tidy
go: finding module for package github.com/google/gousb
go: finding module for package github.com/google/gousb/usbid
go: found github.com/google/gousb in github.com/google/gousb v1.1.3
go: found github.com/google/gousb/usbid in github.com/google/gousb v1.1.3
C:\Users\jgust\go\programas\gousb\lsusb>go build main.go
The text was updated successfully, but these errors were encountered: