RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-507516

nchistov's questions

Martin Hope
чистов_n
Asked: 2023-12-13 21:00:24 +0000 UTC

错误错误:转换为执行字符集:运行 fyne 应用程序时出现非法字节序列

  • 5

我fyne通过运行以下命令进行安装:

go get fyne.io/fyne/v2@latest
go install fyne.io/fyne/v2/cmd/fyne@latest

一切都安装得很完美。

运行这个简单的应用程序时:

package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/widget"
)

func main() {
    a := app.New()
    w := a.NewWindow("Hello World")

    w.SetContent(widget.NewLabel("Hello World!"))
    w.ShowAndRun()
}

该命令go run .产生了此错误:

C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\driver\glfw\driver_desktop.go:18:2: missing go.sum entry for module providing package fyne.io/systray (imported by fyne.io/fyne/v2/internal/driver/glfw); to add:                                                                                                             
        go get fyne.io/fyne/v2/internal/driver/[email protected]                                                    
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\storage\repository\parse.go:9:2: missing go.sum entry for module providing package github.com/fredbi/uri (imported by fyne.io/fyne/v2/storage/repository); to add:       
        go get fyne.io/fyne/v2/storage/[email protected]                                                      
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\app\settings_desktop.go:11:2: missing go.sum entry for module providing package github.com/fsnotify/fsnotify (imported by fyne.io/fyne/v2/app); to add:                  
        go get fyne.io/fyne/v2/[email protected]                                                                     
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\driver\glfw\driver.go:12:2: missing go.sum entry for module providing package github.com/fyne-io/image/ico (imported by fyne.io/fyne/v2/internal/driver/glfw); to add:                                                                                                        
        go get fyne.io/fyne/v2/internal/driver/[email protected]                                                    
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\gl\gl_core.go:9:2: missing go.sum entry for module providing package github.com/go-gl/gl/v2.1/gl (imported by fyne.io/fyne/v2/internal/painter/gl); to add:                                                                                                           
        go get fyne.io/fyne/v2/internal/painter/[email protected]                                                     
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\driver\glfw\clipboard.go:12:2: missing go.sum entry for module providing package github.com/go-gl/glfw/v3.3/glfw (imported by fyne.io/fyne/v2/internal/driver/glfw); to add:                                                                                                  
        go get fyne.io/fyne/v2/internal/driver/[email protected]                                                    
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\font.go:11:2: missing go.sum entry for module providing package github.com/go-text/render (imported by fyne.io/fyne/v2/internal/painter); to add:       
        go get fyne.io/fyne/v2/internal/[email protected]                                                        
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\font.go:12:2: missing go.sum entry for module providing package github.com/go-text/typesetting/di (imported by fyne.io/fyne/v2/widget); to add:         
        go get fyne.io/fyne/v2/[email protected]                                                                  
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\font.go:13:2: missing go.sum entry for module providing package github.com/go-text/typesetting/font (imported by fyne.io/fyne/v2/internal/painter); to add:                                                                                                           
        go get fyne.io/fyne/v2/internal/[email protected]                                                        
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\font.go:14:2: missing go.sum entry for module providing package github.com/go-text/typesetting/shaping (imported by fyne.io/fyne/v2/widget); to add:    
        go get fyne.io/fyne/v2/[email protected]                                                                  
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\svg\svg.go:16:2: missing go.sum entry for module providing package github.com/srwiley/oksvg (imported by fyne.io/fyne/v2/internal/svg); to add:                 
        go get fyne.io/fyne/v2/internal/[email protected]                                                            
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\svg\svg.go:17:2: missing go.sum entry for module providing package github.com/srwiley/rasterx (imported by fyne.io/fyne/v2/internal/painter); to add:           
        go get fyne.io/fyne/v2/internal/[email protected]                                                        
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\widget\markdown.go:8:2: missing go.sum entry for module providing package github.com/yuin/goldmark (imported by fyne.io/fyne/v2/widget); to add:                         
        go get fyne.io/fyne/v2/[email protected]                                                                  
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\widget\markdown.go:9:2: missing go.sum entry for module providing package github.com/yuin/goldmark/ast (imported by fyne.io/fyne/v2/widget); to add:                     
        go get fyne.io/fyne/v2/[email protected]                                                                  
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\widget\markdown.go:10:2: missing go.sum entry for module providing package github.com/yuin/goldmark/renderer (imported by fyne.io/fyne/v2/widget); to add:               
        go get fyne.io/fyne/v2/[email protected]                                                                  
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\image.go:8:2: missing go.sum entry for module providing package golang.org/x/image/draw (imported by fyne.io/fyne/v2/internal/painter); to add:         
        go get fyne.io/fyne/v2/internal/[email protected]                                                        
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\draw.go:10:2: missing go.sum entry for module providing package golang.org/x/image/math/fixed (imported by fyne.io/fyne/v2/widget); to add:             
        go get fyne.io/fyne/v2/[email protected]                                                                  
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\app\app_windows.go:14:2: missing go.sum entry for module providing package golang.org/x/sys/execabs (imported by fyne.io/fyne/v2/app); to add:                           
        go get fyne.io/fyne/v2/[email protected]                                                                     
C:\Users\Николай\go\pkg\mod\fyne.io\fyne\[email protected]\internal\driver\glfw\window_windows.go:11:2: missing go.sum entry for module providing package golang.org/x/sys/windows/registry (imported by fyne.io/fyne/v2/app); to add:                                                                                                            
        go get fyne.io/fyne/v2/[email protected]

通过运行命令可以修复此问题(如错误消息中所述):

go get fyne.io/fyne/v2/[email protected]

但是当我启动这个应用程序时,这个错误再次显示,我无法以任何方式解决:

# github.com/go-gl/glfw/v3.3/glfw                                                                             
In file included from C:\Users\Николай\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]\c_glfw.go:4:                                                                                           
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/context.c: In function 'glfwSwapBuffers':                                                                           
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/context.c:644:1: error: converting to execution character set: Illegal byte sequence                                
  644 |     assert(window != NULL);                                                                           
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~                                                                           
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/context.c: In function 'glfwExtensionSupported':                                                                    
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/context.c:678:1: error: converting to execution character set: Illegal byte sequence                                
  678 |     assert(extension != NULL);                                                                        
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                        
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/context.c: In function 'glfwGetProcAddress':                                                                        
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/context.c:744:1: error: converting to execution character set: Illegal byte sequence                                
  744 |     assert(procname != NULL);                                                                         
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~~~                                                                         
                                                                                                              
In file included from C:\Users\Николай\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]\c_glfw.go:6:                                                                                           
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/input.c: In function 'glfwGetInputMode':                                                                            
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/input.c:492:1: error: converting to execution character set: Illegal byte sequence                                  
  492 |     assert(window != NULL);                                                                           
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~                                                                           
                                                                                                              
...

<Здесь что-то такое же.>

...
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/window.c: In function 'glfwSetWindowContentScaleCallback':                                                          
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/window.c:1061:1: error: converting to execution character set: Illegal byte sequence                                
 1061 |     assert(window != NULL);                                                                           
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~                                                                           
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/window.c: In function 'glfwWaitEventsTimeout':                                                                      
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/window.c:1083:1: error: converting to execution character set: Illegal byte sequence                                
 1083 |     assert(timeout == timeout);                                                                       
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                       
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/window.c:1084:1: error: converting to execution character set: Illegal byte sequence                                
 1084 |     assert(timeout >= 0.0);                                                                           
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~                                                                           
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/window.c:1085:1: error: converting to execution character set: Illegal byte sequence                                
 1085 |     assert(timeout <= DBL_MAX);                                                                       
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                       
                                                                                                              
In file included from C:\Users\Николай\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]\c_glfw.go:10:                                                                                          
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c: In function '_glfwCreateContextOSMesa':                                                           
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:224:1: error: converting to execution character set: Illegal byte sequence                         
  224 |         setAttrib(OSMESA_FORMAT, OSMESA_RGBA);                                                        
      | ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                        
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:225:1: error: converting to execution character set: Illegal byte sequence                         
  225 |         setAttrib(OSMESA_DEPTH_BITS, fbconfig->depthBits);                                            
      | ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                            
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:226:1: error: converting to execution character set: Illegal byte sequence                         
  226 |         setAttrib(OSMESA_STENCIL_BITS, fbconfig->stencilBits);                                        
      | ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                        
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:227:1: error: converting to execution character set: Illegal byte sequence                         
  227 |         setAttrib(OSMESA_ACCUM_BITS, accumBits);                                                      
      | ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                      
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:231:1: error: converting to execution character set: Illegal byte sequence                         
  231 |             setAttrib(OSMESA_PROFILE, OSMESA_CORE_PROFILE);                                           
      | ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                           
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:235:1: error: converting to execution character set: Illegal byte sequence                         
  235 |             setAttrib(OSMESA_PROFILE, OSMESA_COMPAT_PROFILE);                                         
      | ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                         
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:240:1: error: converting to execution character set: Illegal byte sequence                         
  240 |             setAttrib(OSMESA_CONTEXT_MAJOR_VERSION, ctxconfig->major);                                
      | ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:241:1: error: converting to execution character set: Illegal byte sequence                         
  241 |             setAttrib(OSMESA_CONTEXT_MINOR_VERSION, ctxconfig->minor);                                
      | ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:251:1: error: converting to execution character set: Illegal byte sequence                         
  251 |         setAttrib(0, 0);                                                                              
      | ^       ~~~~~~~~~~~~~~~~                                                                              
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c: In function 'glfwGetOSMesaColorBuffer':                                                           
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:303:1: error: converting to execution character set: Illegal byte sequence                         
  303 |     assert(window != NULL);                                                                           
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~                                                                           
                                                                                                              
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c: In function 'glfwGetOSMesaDepthBuffer':                                                           
C:\Users\�������\go\pkg\mod\github.com\go-gl\glfw\v3.3\[email protected]/glfw/src/osmesa_context.c:342:1: error: converting to execution character set: Illegal byte sequence                         
  342 |     assert(window != NULL);                                                                           
      | ^   ~~~~~~~~~~~~~~~~~~~~~~~

此外,出现此错误后,程序不会停止工作,您必须通过按Ctrl+来终止它C。

golang
  • 1 个回答
  • 35 Views
Martin Hope
чистов_n
Asked: 2023-10-09 18:49:02 +0000 UTC

如何从进程ID获取rusage?

  • 6

我有一个运行一些系统命令并获取此进程的 id 的代码:

package main

import (
    "fmt"
    "strings"
    "os"
    "os/exec"
)

func main() {   
    cmd := strings.Join(os.Args[1:], " ")

    p := exec.Command("cmd.exe", "/C", cmd)
    
    p.Start()
    pid := p.Process.Pid

    fmt.Println(pid)
}

然后我需要使用 this 来获取pid结构Rusage,它在模块中golang.org/x/sys/windows,但我还没有找到获取它的函数。

UPD:您可以获得包含相同信息的其他一些结构。

PS:这一切都是在Windows下完成的。

我在网上搜索了很多,但没有找到合适的。

PPS:我知道github.com/shirou/gopsutil,但那里也没有类似的东西:(

windows
  • 1 个回答
  • 47 Views
Martin Hope
чистов_n
Asked: 2023-08-31 21:26:40 +0000 UTC

如何在 Chrome 开发者工具中禁用文件缓存?

  • 5

当你编写网站时,如果浏览器缓存了任何文件(最常见的是css),那是非常不方便的。

当然,这不会立即发生,而是几天后发生。

如何在 Chrome 开发者工具中禁用文件缓存?

PS:已经有类似的东西:Google Chrome caching after update/developer panel,但这个问题已经过时了。

google-chrome
  • 2 个回答
  • 31 Views
Martin Hope
nchistov
Asked: 2023-08-01 17:07:24 +0000 UTC

GDScript 中 `var ... = ...` 和 `var ... := ...` 有什么区别?

  • 6

GDScript中有这样的代码:

var a := 5

像这样:

var a = 5

两个代码在执行时都会创建一个名为 namea和 value的变量5。

但这两个选项有什么区别呢?

godot
  • 1 个回答
  • 39 Views
Martin Hope
nchistov
Asked: 2023-06-30 16:08:37 +0000 UTC

Go 语言中如何检查数组是否包含值?

  • 5

我正在学习 GoLang,如何检查数组中是否有值变得很有趣。

有一个函数strings.Contains,但它检查字符串中是否有字符串,而不是数组。

有这个功能吗,还是我需要自己写?

массивы
  • 2 个回答
  • 30 Views
Martin Hope
nchistov
Asked: 2023-02-16 18:54:19 +0000 UTC

使用静态是什么意思?

  • 7

当我从 Mark Price 的书中学习 C# 时C# 9 и .NET 5,我遇到了这句话:

<...>

System.Console在文件顶部添加静态类导入语句Program.cs:

using static System.Console

<...>

我不明白这是什么意思для статического импорта класса,决定问这个问题。

是不是可以这样写:

using System.Console

你能解释一下吗?

我希望一切都清楚,如果没有,请写在评论中。

c#
  • 1 个回答
  • 36 Views
Martin Hope
nchistov
Asked: 2023-02-12 18:38:43 +0000 UTC

如何更改语言

  • 7

我正在从 Mark Price 的书中学习 C# C#9 и .NET 5。

有一类Person:

using static System.Console;

namespace Packt.Shared {
    public class Person
    {
        public string? Name;
        public DateTime DateOfBirth;
    }
}

当显示一个人的信息时:

var bob = new Person();
bob.Name = "Bob Smith";
bob.DateOfBirth = new DateTime(1965, 12, 22);

WriteLine(
    format: "{0} was born on {1:dddd, d MMMM yyyy}",
    arg0: bob.Name,
    arg1: bob.DateOfBirth
);

产生稍微难看的输出:

Bob Smith was born on среда, 22 декабря 1965

我的问题是如何更改输出语言。例如,输出应如下所示:

Bob Smith was born on Wensday, 22 December 1965

我希望一切都清楚,如果没有,请写在评论中。

c#
  • 1 个回答
  • 40 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5