首頁 >後端開發 >Golang >如何在 Golang 中將 Raylib 編譯為 WASM?

如何在 Golang 中將 Raylib 編譯為 WASM?

王林
王林轉載
2024-02-06 08:36:04660瀏覽

如何在 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刪除