dsh77114 2018-07-10 09:25
浏览 131
已采纳

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 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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效