c++ code not compiling in RH9

Discussion in 'C++' started by mike, Oct 1, 2003.

  1. mike

    mike Guest

    Hi

    I wrote some code ages ago when I was not very hot on c++ but it
    worked just fine. I had no problems compiling it on redhat 7.3 but
    that box died recently so I tried compiling the code on my new RH 9
    box and got the following error

    In file included from /usr/include/c++/3.2.2/cstdlib:52,
    from /usr/include/c++/3.2.2/bits/stl_algobase.h:67,
    from /usr/include/c++/3.2.2/memory:54,
    from /usr/include/c++/3.2.2/string:48,
    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 lapackcmplx.h:8,
    from tmatrix.cpp:2:
    /usr/include/stdlib.h:742: parse error before `int'
    In file included from /usr/include/c++/3.2.2/bits/stl_algobase.h:67,
    from /usr/include/c++/3.2.2/memory:54,
    from /usr/include/c++/3.2.2/string:48,
    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 lapackcmplx.h:8,
    from tmatrix.cpp:2:
    /usr/include/c++/3.2.2/cstdlib:90: `abs' not declared

    can anyone shed any light on this?

    Thanks
    Mike
    mike, Oct 1, 2003
    #1
    1. Advertising

  2. mike wrote:

    > /usr/include/c++/3.2.2/cstdlib:90: `abs' not declared
    >
    > can anyone shed any light on this?



    I think "abs" is not declared.
    Gianni Mariani, Oct 1, 2003
    #2
    1. Advertising

  3. mike

    mike Guest

    Gianni Mariani <> wrote in message
    >
    > > /usr/include/c++/3.2.2/cstdlib:90: `abs' not declared
    > >
    > > can anyone shed any light on this?

    >
    >
    > I think "abs" is not declared.


    That much is clear - what I am wondering is why was it declared when I
    compiled it under RH 7.3 but it is not under RH 9.
    mike, Oct 2, 2003
    #3
  4. mike

    Gavin Deane Guest

    (mike) wrote in message news:<>...
    > Gianni Mariani <> wrote in message
    > >
    > > > /usr/include/c++/3.2.2/cstdlib:90: `abs' not declared
    > > >
    > > > can anyone shed any light on this?

    > >
    > >
    > > I think "abs" is not declared.

    >
    > That much is clear - what I am wondering is why was it declared when I
    > compiled it under RH 7.3 but it is not under RH 9.


    So am I. But without seeing the code I would be guessing. I can get
    the error Gianni singled out with this:

    int main()
    {
    abs(42);
    return 0;
    }

    But I suspect your problem is more complicated.

    GJD
    Gavin Deane, Oct 2, 2003
    #4
  5. mike wrote:

    > Gianni Mariani <> wrote in message
    >
    >>>/usr/include/c++/3.2.2/cstdlib:90: `abs' not declared
    >>>
    >>>can anyone shed any light on this?

    >>
    >>
    >>I think "abs" is not declared.

    >
    >
    > That much is clear - what I am wondering is why was it declared when I
    > compiled it under RH 7.3 but it is not under RH 9.


    My guess would be that RH 9 comes with a much more up to date version of
    the compiler (7, IIRC, didn't even come with a "real" gcc - it was an
    unofficial version that wasn't supposed to be released).

    Chances are, if this version of gcc says there's an error it the code,
    there's an error in the code, and the old version was wrong to accept it.

    I suspect the problem may be that you are using abs() rather than
    std::abs(), and you don't have an appropriate 'using' declaration.

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
    Kevin Goodsell, Oct 2, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michal M
    Replies:
    7
    Views:
    787
    Andrew Thompson
    Aug 2, 2005
  2. Jeroen N. Witmond

    Anybody have experience with xalan on RH9?

    Jeroen N. Witmond, Jul 15, 2003, in forum: XML
    Replies:
    0
    Views:
    774
    Jeroen N. Witmond
    Jul 15, 2003
  3. Sergey Schetinin

    bsddb built for concurrent access (rh9)

    Sergey Schetinin, Nov 17, 2004, in forum: Python
    Replies:
    0
    Views:
    334
    Sergey Schetinin
    Nov 17, 2004
  4. Replies:
    1
    Views:
    291
    Victor Bazarov
    Sep 28, 2006
  5. Himanshu Garg
    Replies:
    2
    Views:
    100
    Himanshu Garg
    Feb 13, 2004
Loading...

Share This Page