首页 >后端开发 >Golang >如何在 Golang 中将 Raylib 编译为 WASM?

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

王林
王林转载
2024-02-06 08:36:04665浏览

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

问题内容

我正在尝试在 Golang 中将 Raylib 编译为 WASM,但是当我运行命令 env GOOS=js GOARCH=wasm go build . Go 似乎无法编译 rcamera,它给了我以下错误消息

# 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

我不知道为什么这个库无法编译,而且我在网上找不到任何东西。也有可能它无法编译整个 Raylib 库,并且 go 无法走到这一步,因为有很多错误消息,但我不知道。


正确答案


我认为目前不可能。 查看 raylib-go 存储库上的问题 #69 和 #119

以上是如何在 Golang 中将 Raylib 编译为 WASM?的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:stackoverflow.com。如有侵权,请联系admin@php.cn删除