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

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

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘