dsh77114
2018-07-10 09:25 阅读 109
已采纳

Nuklear GUI演示未运行

I am trying to run demo file at https://github.com/golang-ui/nuklear/blob/master/cmd/nk-example-sdl2/main.go but I am getting following error:

# command-line-arguments
./nk_nuclear_gui.go:72: undefined: MustAsset
./nk_nuclear_gui.go:126: undefined: flag
./nk_nuclear_gui.go:129: undefined: flag

I believe MustAsset is part of Reckon package which I installed, but error persists. Where is the problem and how can I solve it?

Edit: Both commands go build main.go and go run main.go give this error. Even go build without any filename is also giving this error as discussed in comments.

I had encountered this problem while installing nuklear package.

I am running following version on Debian Stable Linux:

go version go1.7.4 linux/amd64

I installed latest version (go version go1.10.3 linux/amd64) from https://golang.org/doc/install but the error persists.

Edit: The directory structure of go directory is as follows:

$ tree -d
.
├── pkg
│   └── linux_amd64
│       └── github.com
│           ├── golang-ui
│           │   └── nuklear
│           └── xlab
└── src
    └── github.com
        ├── go-gl
        │   ├── gl
        │   │   ├── all-core
        │   │   │   └── gl
        │   │   ├── v2.1
        │   │   │   └── gl
        │   │   ├── v3.1
        │   │   │   └── gles2
        │   │   ├── v3.2-compatibility
        │   │   │   └── gl
        │   │   ├── v3.2-core
        │   │   │   └── gl
        │   │   ├── v3.3-compatibility
        │   │   │   └── gl
        │   │   ├── v3.3-core
        │   │   │   └── gl
        │   │   ├── v4.1-compatibility
        │   │   │   └── gl
        │   │   ├── v4.1-core
        │   │   │   └── gl
        │   │   ├── v4.2-compatibility
        │   │   │   └── gl
        │   │   ├── v4.2-core
        │   │   │   └── gl
        │   │   ├── v4.3-compatibility
        │   │   │   └── gl
        │   │   ├── v4.3-core
        │   │   │   └── gl
        │   │   ├── v4.4-compatibility
        │   │   │   └── gl
        │   │   ├── v4.4-core
        │   │   │   └── gl
        │   │   ├── v4.5-compatibility
        │   │   │   └── gl
        │   │   ├── v4.5-core
        │   │   │   └── gl
        │   │   ├── v4.6-compatibility
        │   │   │   └── gl
        │   │   └── v4.6-core
        │   │       └── gl
        │   └── glfw
        │       ├── scripts
        │       ├── v3.0
        │       │   └── glfw
        │       ├── v3.1
        │       │   └── glfw
        │       │       └── glfw
        │       │           ├── deps
        │       │           │   ├── EGL
        │       │           │   ├── GL
        │       │           │   ├── glad
        │       │           │   └── KHR
        │       │           ├── include
        │       │           │   └── GLFW
        │       │           └── src
        │       └── v3.2
        │           └── glfw
        │               └── glfw
        │                   ├── deps
        │                   │   ├── glad
        │                   │   ├── KHR
        │                   │   ├── mingw
        │                   │   └── vulkan
        │                   ├── include
        │                   │   └── GLFW
        │                   └── src
        ├── golang-ui
        │   └── nuklear
        │       ├── assets
        │       ├── cmd
        │       │   ├── nk-android
        │       │   │   ├── android
        │       │   │   │   └── jni
        │       │   │   └── assets
        │       │   ├── nk-example
        │       │   │   └── assets
        │       │   └── nk-example-sdl2
        │       │       └── assets
        │       └── nk
        └── xlab
            └── closer
                └── cmd
                    ├── example
                    ├── example-error
                    ├── example-fatalln
                    └── example-panic
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dongshao4207 dongshao4207 2018-07-11 09:09

    In Go, programs (and package) are based on directory. So very often, multiple source files complement each other. In this case, the MustAsset is defined in bindata.go. Therefore isolating main.go raises an error. You can read more about Go's source file organization here: https://golang.org/doc/code.html

    点赞 评论 复制链接分享

相关推荐