我正在尝试编译从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 ~ $
答案 0 :(得分:2)
iostream.h
是标题的旧标准名称,后来成为C ++标准库。现代标准化名称仅为iostream
,没有.h
。
最佳解决方案是浏览源代码并将iostream.h
更改为iostream
。但是,如果您尝试编译的C ++代码真的很古老,那么您可能会遇到其他问题。另一方面它可能工作正常,只有一些警告。试一试,看看会发生什么。
如果它不起作用,您可能会发现“compat -g ++”包(具有非常旧的3.4版本的g ++)比4.8更好地处理这个旧代码。