Menu

Anyone building on HP-UX?

Anonymous
2001-05-14
2001-05-18
  • Anonymous

    Anonymous - 2001-05-14

    I'm interested in building cppunit on HP-UX 11.00 using HP's aCC compiler, but I run into a couple of problems with std:: and such. Before I start trying to solve these problems on my own I just wanted to check if anyone has already been there.

    Is that the case?

    /Snebjrn

     
    • Peer Sommerlund

      Peer Sommerlund - 2001-05-17

      I havn't, but I tried compiling it on Alpha with cxx, and also had a problem with std::

      I have submitted patch 403479 that fixed the std:: problem for me (as well as a few other problems). If you want to try the patch you should note that it was closed because std:: apparently works everywhere else.

      Basically, by removing std:: the compiler accepts the code. I think this is because the compiler does an implicit "using namespace std". I'm not sure why other compilers require the std:: prefix.

       
    • Bastiaan Bakker

      Bastiaan Bakker - 2001-05-17

      Hi Peer,

      The reasons your patch was closed are:
      1) It breaks/degenerates other platforms, so it can't be merged.
      2) It's out of date: against 1.5.3 so it would not fix 1.5.5

      The reason other compilers require the std:: prefix, is that they follow the C++ standard! The C++ standard library classes live in namespace std.
      A 'using namespace std' does not imply you can't refer to a class through the std namespace: 'std::string name' should still be possible.
      The reason you can't do that with cxx is because it apparently ships with a non C++ standard compliant library, either because cxx does not properly implement namespaces or for other reasons.
      You should be able to work around it by creating either a namespace or class called 'std' and import the necessary classes into it.
      Since Snebjrn has to deal with the same problem, it may be worthwhile to work this out together. A patch that does not harm other platforms will gladly be accepted.

      Bastiaan

       
      • Peer Sommerlund

        Peer Sommerlund - 2001-05-18

        I have updated the patch to cppunit 1.5.5, see patch 425178

        I had some problems with the arguments libtool generated, so the patch modifies libtool. I'm not sure if a newer version of libtool solves this problem.

        I tried to tweak the STL library (from RougeWave) with a few compiler directives. This allowed the code to compile with std:: prefixes. Note that the -D options were found by reverse engineering, so they may not have been the correct ones.

        Using std:: as a prefix is valid code by the standard, but is it not also valid to leave it out? Leaving it out may help Snebjrn.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.