2013-12-22 111 views
5

我是C++的新手,我是自学的。我正在使用code::blocks,并有一个问题。当我写你好世界时,没有任何反应。这是在调试器窗口说:C++ hello world不工作?

Building to ensure sources are up-to-date 
Selecting target: 
Debug 
ERROR: You need to specify a debugger program in the debuggers's settings. 
(For MinGW compilers, it's 'gdb.exe' (without the quotes)) 
(For MSVC compilers, it's 'cdb.exe' (without the quotes)) 

这里是程序:

#include <iostream> 

using namespace std; 

int main() 
{ 
    cout << "Helloworld!" << endl; 
    return 0; 
} 

此外,如果你需要它,这里是生成日志:

"hello world again - Debug": The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler. 
Probably the toolchain path within the compiler options is not setup correctly?! 
Goto "Settings->Compiler and debugger...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup. 
Skipping... 
Nothing to be done (all items are up-to-date). 
+0

全局编译器设置中有什么?是否有调试器填写? – chris

+0

如果你在没有调试器的情况下运行它,你的程序可能工作正常。 –

回答

6

尝试再次下载调试器和编译器。当我遇到这个问题时它对我有效。尝试从互联网上下载'gdb.exe'。

+0

,不会安装...每次我现在运行,它问我是否要建立它。当我点击“是”时,它会一遍又一遍地提问。我正在使用code :: blocks。点击no会打开一个没有任何内容的空白cmd。 –

+0

我也使用code :: blocks。尝试重新安装C :: B(Code :: blocks)。 – ioanD

+0

你有没有安装和卸载monodevelop或重写DLL文件的东西? – ioanD