0

我正在尝试编译从http://xmacro.sourceforge.net/下载的 xmacro 。

我正在运行 Fedora 19 LXDE。

问题:我从哪里获得 iostream.h?它不见了。我看到一些包含 iostream.h 的包。软件包版本号 compat-gcc-34-c++.i686 与 g++ (GCC) 4.8.1 20130603 不匹配。应该吗?

我认为下载编译器时会包含 iostream.h。

我已经安装了 gcc-c++、libx11-devel 和 libxtxt。

问题:我得到了正确版本的 c++ 吗?什么是兼容性 GNU 编译器集合?

$ yum search "compat-gcc"
Loaded plugins: langpacks, refresh-packagekit
=========================================== N/S matched: compat-gcc ============================================
compat-gcc-34.i686 : Compatibility GNU Compiler Collection
compat-gcc-34-c++.i686 : C++ support for compatibility compiler
compat-gcc-34-g77.i686 : Fortran 77 support for compatibility compiler

  Name and summary matches only, use "search all" for everything.

我得到:

$ make
g++ -O2  -I/usr/X11R6/include -Wall -pedantic -DVERSION=0.3 xmacroplay.cpp -o xmacroplay -L/usr/X11R6/lib -lXtst -lX11
xmacroplay.cpp:57:22: fatal error: iostream.h: No such file or directory
 #include <iostream.h>
                      ^
compilation terminated.
make: *** [xmacroplay] Error 1




$ yum whatprovides '*/iostream.h'
Loaded plugins: langpacks, refresh-packagekit
compat-gcc-34-c++-3.4.6-29.fc19.i686 : C++ support for compatibility compiler
Repo        : fedora
Matched from:
Filename    : /usr/include/c++/3.4.6/backward/iostream.h



cxxtools-devel-2.2-1.fc19.i686 : Development files for cxxtools
Repo        : fedora
Matched from:
Filename    : /usr/include/cxxtools/iostream.h



gap-devel-4.6.4-2.fc19.i686 : GAP compiler and development files
Repo        : fedora
Matched from:
Filename    : /usr/lib/gap/src/iostream.h



gap-devel-4.6.5-1.fc19.i686 : GAP compiler and development files
Repo        : updates
Matched from:
Filename    : /usr/lib/gap/src/iostream.h



glibmm24-devel-2.36.2-2.fc19.i686 : Headers for developing programs that will use glibmm24
Repo        : fedora
Matched from:
Filename    : /usr/include/giomm-2.4/giomm/iostream.h



marisa-devel-0.2.2-2.fc19.i686 : Development files for marisa
Repo        : fedora
Matched from:
Filename    : /usr/include/marisa/iostream.h



mingw32-glibmm24-2.36.2-2.fc19.noarch : MinGW Windows C++ interface for GTK2 (a GUI library for X)
Repo        : fedora
Matched from:
Filename    : /usr/i686-w64-mingw32/sys-root/mingw/include/giomm-2.4/giomm/iostream.h



mingw64-glibmm24-2.36.2-2.fc19.noarch : MinGW Windows C++ interface for GTK2 (a GUI library for X)
Repo        : fedora
Matched from:
Filename    : /usr/x86_64-w64-mingw32/sys-root/mingw/include/giomm-2.4/giomm/iostream.h



root-cint-5.34.07-1.fc19.i686 : CINT C++ interpreter
Repo        : fedora
Matched from:
Filename    : /usr/lib/root/cint/cint/include/iostream.h



root-cint-5.34.10-1.fc19.i686 : CINT C++ interpreter
Repo        : updates
Matched from:
Filename    : /usr/lib/root/cint/cint/include/iostream.h



me ~ $ g++ --version
g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

me ~ $ 
4

1 回答 1

2

iostream.h是后来成为 C++ 标准库的标头的旧的、预标准的名称。现代、标准化的名称只是iostream,没有.h.

最好的解决方案是遍历源并更改iostream.hiostream无处不在。但是,如果您尝试编译的 C++ 代码确实很古老,您可能会遇到其他问题。另一方面,它可能工作正常,但有一些警告。试一试,看看会发生什么。

如果它不起作用,您可能会发现“compat-g++”包(它具有非常旧的 3.4 版本的 g++)比 4.8 更好地处理这个旧代码。

于 2013-10-24T08:34:57.053 回答