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++ を入手しましたか? Compatibility GNU Compiler Collectionとは?

$ 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.hすることです。iostreamただし、コンパイルしようとしている C++ コードが本当に古い場合は、別の問題が発生する可能性があります。一方、いくつかの警告はありますが、問題なく動作する場合があります。試してみて、何が起こるか見てみましょう。

うまくいかない場合は、"compat-g++" パッケージ (g++ の非常に古い 3.4 バージョンを含む) が、この古いコードを 4.8 よりもうまく処理できることに気付くかもしれません。

于 2013-10-24T08:34:57.053 に答える