在CodeBlocks下运行“ hello world”程序

问题描述

#include <iostream>
using namespace std;

int main()
{
    int a {};
    a = 10;
    cout << "Hello World!" << a << endl;
    return 0;
}

然后我在下面出现错误

-------------- Run: Debug in First (compiler: GNU GCC Compiler)---------------

Checking for existence: /home/oem/CPlus/First/bin/Debug/First
Set variable: LD_LIBRARY_PATH=.:
Executing: xterm -T First -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=:. /home/oem/CPlus/First/bin/Debug/First  (in /home/oem/CPlus/First/.)
Process terminated with status -1 (0 minute(s),0 second(s))

我的系统是Linux mint20。 g ++和gcc均为9.3.0。

解决方法

我已经解决了这个问题。 我可以使用调试按钮。只是不能使用运行按钮。 工具菜单->设置->环境->终端到lanuch控制台程序(设置终端控制台程序)