所以我一直在尝试安装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/