我试图从这里运行代码,和我发现自己被这个错误信息困住了:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix
我正在尝试在我的go应用程序中启动一个web服务器。当我在Windows上运行我的代码时,一切工作正常。应用程序运行,启动web服务器,然后等待。在linux上,它似乎做了同样的事情,除了我无法访问web服务器。
如果我在没有使用goroutine的情况下启动web服务器,那么只有当我使用goroutine时,它才会失败。
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
// go startWebServer() // This on
因此,当我使用std::process::命令在linux终端中运行一个命令时,我会收到这个错误。守则的部分内容是:
use std::process::Command;
fn main() {
let mut playmusic = "mpv https://www.youtube.com/watch?v=kJQP7kiw5Fk";
let status = Command::new(playmusic).status().expect("error status");
}
上面的命令代码,我在铁锈上找到的。我尝试了文档中的所有内容,