Ask Your Question
1

compilation cannot find the C++ supporting file

asked 2014-09-17 01:27:34 -0500

debasishm gravatar image

updated 2014-09-17 09:41:54 -0500

FranciscoD_ gravatar image

Hi,

I have installed gcc-g++ on the fedora machine.. It got installed succesfully. But when i compile my old code which i used to compile on red hat. The code compilation is failing stating the iostream.h not found.

How do i set the includehearder path. As those files are not there in /usr/include or any common path.

Thanks Debasish

edit retag flag offensive close merge delete

Comments

Can you try yum install libstdc++-devel?

cma gravatar imagecma ( 2014-09-17 01:47:14 -0500 )edit

I have that package installed, it does not give me /usr/include/iostream.h.

cobra gravatar imagecobra ( 2014-09-17 08:25:51 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
3

answered 2014-09-17 08:30:17 -0500

cobra gravatar image

updated 2014-09-17 08:31:21 -0500

I believe you should be using:

#include <iostream>

If you want to use the C version rather than the C++, you may need C libraries.

For me doing locate iostream returns this stuff:

/usr/include/c++/4.8.3/iostream
/usr/include/glib-2.0/gio/gfileiostream.h
/usr/include/glib-2.0/gio/giostream.h

and a few others but locate iostream.h returns no matches.

edit flag offensive delete link more
0

answered 2014-09-17 21:34:05 -0500

updated 2014-09-17 21:36:42 -0500

$ repoquery --whatprovides \*/iostream.h --queryformat "%{name}"
root-cint
root-cint
root-cint
glibmm24-devel
gap-devel
marisa-devel
cxxtools-devel
gap-devel
marisa-devel
root-cint
cxxtools-devel
compat-gcc-34-c++
glibmm24-devel
libgap-devel
mingw64-glibmm24
mingw32-glibmm24
libgap-devel

I'd guess you'd want compat-gcc-34-c++

$ repoquery -ql compat-gcc-34-c++|grep iostream.h
/usr/include/c++/3.4.6/backward/iostream.h
edit flag offensive delete link more
0

answered 2014-09-17 01:30:58 -0500

pnemade gravatar image

updated 2014-09-17 09:15:31 -0500

you are missing boost-devel package.

edit flag offensive delete link more

Comments

My initial thought when reading this answer was that it wasn't right - boost doesn't give you access to the stl. So I tested it - I didn't have boost-devel install, so I installed it with yum; it's a 9.7 MB download. Then I did updatedb to refresh my file lists and then did locate iostream.h. It now gives me this list:

/usr/include/boost/asio/basic_socket_iostream.hpp
/usr/include/boost/iostreams/detail/iostream.hpp
/usr/include/boost/typeof/std/iostream.hpp
/usr/include/glib-2.0/gio/gfileiostream.h
/usr/include/glib-2.0/gio/giostream.h

so still no iostream.h. This answer is incorrect.

cobra gravatar imagecobra ( 2014-09-17 09:53:26 -0500 )edit

thanks. I thought that will help. Need to check more on this.

pnemade gravatar imagepnemade ( 2014-09-17 19:36:12 -0500 )edit

@cobra - try repoquery -ql boost-devel :)

randomuser gravatar imagerandomuser ( 2014-09-17 21:30:47 -0500 )edit

@randomuser Yep, did that. It gives me a huge list of files - but no iostream.h. Every header file it provides is in the boost area. I already did the ultimate test anyway - I installed that package. It appears (as I said above) to provide some boost alternatives or wrappers for iostream, but not iostream.h itself. Your answer to this question here also demonstrates that boost does not solve this problem.

cobra gravatar imagecobra ( 2014-09-18 05:28:49 -0500 )edit

@cobra - right, just poining out a method to check the files an RPM provides without actually installing it and using locate. I didn't expect the result to change becase you got the info differently.

randomuser gravatar imagerandomuser ( 2014-09-18 21:52:56 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-17 01:27:34 -0500

Seen: 1,549 times

Last updated: Sep 17 '14