Home > Backend Development > Golang > How to compile Raylib to WASM in Golang?

How to compile Raylib to WASM in Golang?

王林
Release: 2024-02-06 08:36:04
forward
660 people have browsed it

如何在 Golang 中将 Raylib 编译为 WASM?

Question content

I am trying to compile Raylib to WASM in Golang, but when I run the command env GOOS=js GOARCH=wasm go build . Go can't seem to compile rcamera, it gives me the following error message

# github.com/gen2brain/raylib-go/raylib
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:196:27: undefined: GetMouseDelta
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:220:56: undefined: GetFrameTime
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:226:6: undefined: IsKeyDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:229:6: undefined: IsKeyDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:232:6: undefined: IsKeyDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:235:6: undefined: IsKeyDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:238:6: undefined: IsKeyDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:241:6: undefined: IsKeyDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:246:8: undefined: IsGamepadAvailable
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:248:29: undefined: IsMouseButtonDown
../../.go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:248:29: too many errors
Copy after login

I don't know why this library won't compile, and I can't find anything online. It's also possible that it fails to compile the entire Raylib library and go doesn't get this far because there are a lot of error messages, but I don't know.


Correct answer


I don’t think it’s possible at the moment. Check out issues #69 and #119

on the raylib-go repository

The above is the detailed content of How to compile Raylib to WASM in Golang?. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template