Example code does not work?
arjunmenon opened this issue · 7 comments
arjunmenon commented
Hey, i am getting this
> go build .
github.com/go-gl/gl/v3.2-core/gl
github.com/golang-ui/nuklear/nk
# github.com/golang-ui/nuklear/nk
cgo-dwarf-inference:1:17: error: expected '{' before ')' token
was checking the nk-example
.
sp-manuel-jurado commented
The same happens to me.
Build example:
...
go: downloading github.com/getlantern/systray v1.2.2
go: downloading github.com/golang-ui/nuklear v0.0.0-20231115163627-2440a671efc5
...
go: downloading github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71
go: downloading github.com/go-gl/glfw v0.0.0-20240506104042-037f3cc74f2a
...
# github.com/getlantern/systray
# [pkg-config --cflags -- ayatana-appindicator3-0.1]
...
# github.com/go-gl/glfw/v3.2/glfw
...
# github.com/golang-ui/nuklear/nk
cgo-dwarf-inference:1:17: error: expected '{' before ')' token
2024/07/16 15:18:55 Failed to cross compile package: exit status 1.
Import go example:
import (
"github.com/go-gl/gl/v3.2-core/gl"
"github.com/go-gl/glfw/v3.2/glfw"
"github.com/golang-ui/nuklear/nk"
)
Notes:
- Using techknowlogick/xgo@bb15aad for cross compiling (
go1.22.5
)
Jamesthe1 commented
Getting this exact error as well from my own code just by having the inclusion. My go.mod looks like:
module test/nktest
go 1.22.5
require (
github.com/golang-ui/nuklear v0.0.0-20231115163627-2440a671efc5
github.com/veandco/go-sdl2 v0.4.40
)
require (
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 // indirect
github.com/go-gl/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect
github.com/xlab/android-go v0.0.0-20221106204035-3cc54d5032fa // indirect
)
and my import looks like:
import (
"log"
"os"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/golang-ui/nuklear/nk"
"github.com/veandco/go-sdl2/sdl"
)
Even go install github.com/golang-ui/nuklear/nk
simply triggers this error without it being present in imports.
Tried indirects as well, same result.
anibaldeboni commented
SDL2 example doesn't work either. It seems like the functions are based on some older nuklear api version, the arguments provided in the examples doesn't match the current api.