安装ddd - 致命错误

时间:2014-01-29 05:36:38

标签: c++ c ddd-debugger

所以我一直在尝试安装DDD。我在Mac OS X 10.9(Mavericks)上安装了最新的Xcode。每当我运行配置文件时,我得到的最后一件事是:

checking whether c++ accepts -g... yes
checking whether the C++ compiler (c++) compiles a simple program... no
configure: error: You must set the environment variable CXX to a working 
                  C++ compiler.  Also check the CXXFLAGS settings.
                  See the file 'config.log' for further diagnostics.

每当我检查config.log文件时,我得到:

configure:2684: c++ -o conftest -g -O2   conftest.C  1>&5
configure:2678:10: fatal error: 'iostream.h' file not found #include <iostream.h>
1 error generated.
configure: failed program was:
#line 2677 "configure"
#include "confdefs.h"
#include <iostream.h>
int main() {
cout << "hello, world!";
; return 0; }

我从sourcefourge下载了gcc并再次安装了gcc-4.9,但我仍然遇到同样的错误。谁知道如何解决这个问题或者问题可能是什么?

1 个答案:

答案 0 :(得分:0)

您似乎正在编译c ++程序,但是将.c文件传递给c++编译器。您将conftest.c文件传递给c ++编译器,它必须是confest.cpp

configure:2684: c++ -o conftest -g -O2 conftest.C 1>&5

这必须是

configure:2684: c++ -o conftest -g -O2 conftest.cpp 1>&5

并且

fatal error: 'iostream.h' file not found #include <iostream.h> 1 error generated.

上述错误更改了您的代码

#included <iostream>

而不是#include <iostream.h>