By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

Problem while including iostream.h in files targetted by ns2.26 make

P: n/a
Hi,
I am using ns2.26 with the Makefile using C++ compiler version c++
(GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk).
When I use iostream.h in a simple program and compile with c++
everything works except I get a deprecated warning.
Using the find command I get the location of iostream.h as
/usr/include/c++/3.2.2/iostream.
Also in my makefile the list of includes are as follows

INCLUDES = \
-I. \
-I/home/pradyot/ns-allinone-2.26/tclcl-1.0b13
-I/home/pradyot/ns-allinone-2.26/otcl-1.0a8
-I/home/pradyot/ns-allinone-2.26/include
-I/home/pradyot/ns-allinone-2.26/include -I/usr/include/pcap \
-I./tcp -I./common -I./link -I./queue \
-I./adc -I./apps -I./mac -I./mobile -I./trace \
-I./routing -I./tools -I./classifier -I./mcast \
-I./diffusion3/lib/main -I./diffusion3/lib \
-I./diffusion3/lib/nr -I./diffusion3/ns \
-I./diffusion3/diffusion -I./asim/ -I./qs \
-I/usr/include/c++/3.2.2 -I/usr/include/c++/3.2.2/backward \
-I/usr/include/c++/3.2.2/bits

The problem I have is that I can't seem to include iostream.h in my
project files targeted by ns make without getting a whole string of
error messages too lengthy to produce but the gist is as follows.
In file included from /usr/include/c++/3.2.2/string:57,
from /usr/include/c++/3.2.2/bits/localefwd.h:49,
from /usr/include/c++/3.2.2/ios:48,
from /usr/include/c++/3.2.2/ostream:45,
from /usr/include/c++/3.2.2/iostream:45,
from /usr/include/c++/3.2.2/backward/iostream.h:32,
/usr/include/c++/3.2.2/bits/basic_string.tcc: In
member function `_Alloc::size_type std::basic_string<_CharT, _Traits,
_Alloc>::rfind(const _CharT*, _Alloc::size_type, _Alloc::size_type)
const':
/usr/include/c++/3.2.2/bits/basic_string.tcc:712: parse error before
`(' token
In file included from
/usr/include/c++/3.2.2/bits/locale_facets.tcc:43,
from /usr/include/c++/3.2.2/locale:46,
from /usr/include/c++/3.2.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2.2/ostream:275,
from /usr/include/c++/3.2.2/iostream:45,
from /usr/include/c++/3.2.2/backward/iostream.h:32,
/usr/include/c++/3.2.2/limits:942:22: macro "min"
requires 2 arguments, but only 1 given
In file included from
/usr/include/c++/3.2.2/bits/locale_facets.tcc:43,
from /usr/include/c++/3.2.2/locale:46,
from /usr/include/c++/3.2.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2.2/ostream:275,
from /usr/include/c++/3.2.2/iostream:45,
from /usr/include/c++/3.2.2/backward/iostream.h:32,
/usr/include/c++/3.2.2/limits: At global scope:
/usr/include/c++/3.2.2/limits:942: parse error before `throw'
/usr/include/c++/3.2.2/limits:943:22: macro "max" requires 2
arguments, but only 1 given
This is followed by a whole bunch of errors in limits.

If anyone can suggest a soln I would be most grateful.
Thanks,
Pradyot
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Pradyot Dhulipala" <pr*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
Hi,
I am using ns2.26 with the Makefile using C++ compiler version c++
(GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk).
When I use iostream.h in a simple program and compile with c++
everything works except I get a deprecated warning.
Using the find command I get the location of iostream.h as
/usr/include/c++/3.2.2/iostream.
Also in my makefile the list of includes are as follows
[snip]

If anyone can suggest a soln I would be most grateful.
Thanks,
Pradyot


Yes use <iostream> not <iostream.h>. Despite what your error message say
<iostream.h> is not and never has been a standard C++ header file, it is not
deprecated, it is plain wrong, use <iostream> instead.

john
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.