QtCreator 返回错误"Cannot change to working directory"

QtCreator returns error "Cannot change to working directory"

本文关键字:to working directory change Cannot 返回 错误 QtCreator      更新时间:2023-10-16

我正试图运行一个简单的HelloWorld程序与Qt Creator代码:

#include <iostream>
using namespace std;
int main()
{
  cout << "Hello World!" << endl;
  return 0;
}

运行时出现错误

Cannot change to working directory '/home/myusername/build-myproject-Desktop-Debug': file or directory not found

许多教程在互联网上告诉我禁用"运行在终端",但我需要这个为我的项目。我的工作目录是/home/myusername/build-myproject- desktop - debug

帮忙吗?

您使用的是哪个操作系统?

我在Linux上,有同样的问题。我的解决方案是使用xterm,并将Qtcreator中的默认终端设置为xterm(在菜单中:工具,然后是选项,然后是环境,然后是终端,那里有"/usr/bin/xterm -e")

您可以安装终结者终端(sudo apt-get install Terminator)并将其用作Qt Creator终端:

工具->选项->环境->系统->终端- - ->"/usr/bin/终结者- x"