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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pradyot Dhulipala

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

    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.tc c: In
    member function `_Alloc::size_t ype std::basic_stri ng<_CharT, _Traits,
    _Alloc>::rfind( const _CharT*, _Alloc::size_ty pe, _Alloc::size_ty pe)
    const':
    /usr/include/c++/3.2.2/bits/basic_string.tc c:712: parse error before
    `(' token
    In file included from
    /usr/include/c++/3.2.2/bits/locale_facets.t cc: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.t cc: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
  • John Harrison

    #2
    Re: Problem while including iostream.h in files targetted by ns2.26 make


    "Pradyot Dhulipala" <pradyot_s@yaho o.com> wrote in message
    news:2debdc60.0 405120509.4723a 77d@posting.goo gle.com...[color=blue]
    > 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
    >[/color]
    [snip]
    [color=blue]
    >
    > If anyone can suggest a soln I would be most grateful.
    > Thanks,
    > Pradyot[/color]

    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


    Comment

    Working...