c++ - 安装 ddd - fatal error

标签 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,但仍然出现同样的错误。任何人都知道如何解决这个问题或者可能是什么问题?

最佳答案

看起来你正在编译 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>

关于c++ - 安装 ddd - fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21422950/

相关文章:

gdb - ddd挂起

c - 为什么使用 DDD 时没有出现设置断点挂起的选项?

c++ - 安全地删除指向指针数组的指针

c++ - 针对许多离散值进行测试的首选方法?

C、free() 上的内存损坏(快速)错误

c - 使用函数将地址写入结构中的指针失败

c++ - SFINAE:它如何与派生类一起工作?

c++ - OpenCV 在 ROI 中绘制 Farneback 光流。

c - 从字符串中读取 float 作为 2 个整数

tk - 如何将 DDD 和 Insight 中的 Motif 主题更改为更愉快的内容?