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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.
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
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.