Compilation was broken due to undef. symbols in compilers with 2 stage

name-lookup (such as gcc >= 3.4). The fix for this is to tell the
compiler what symbols to use withlines like: using MultiArg<T>::_name;

This is now done and everything compiles fine. Since I'm not sure
about the support for things like using MultiArg<T>::_name; on all
compilers it is ifdef:ed away by default. To get 2 stage name-lookup
to work you have to add -DTWO_STAGE_NAME_LOOKUP to your CXXFLAGS
before running configure.
This commit is contained in:
macbishop 2004-09-04 21:09:37 +00:00
parent b34918c2fe
commit b2c9942f51
2 changed files with 26 additions and 0 deletions

View File

@ -28,6 +28,8 @@
#include <sstream> #include <sstream>
#include <tclap/Visitor.h> #include <tclap/Visitor.h>
#include <tclap/Arg.h>
using namespace std; using namespace std;
namespace TCLAP { namespace TCLAP {
@ -40,6 +42,17 @@ namespace TCLAP {
template<class T> template<class T>
class UnlabeledMultiArg : public MultiArg<T> class UnlabeledMultiArg : public MultiArg<T>
{ {
#ifdef TWO_STAGE_NAME_LOOKUP
//If compiler has two stage name lookup (as gcc >= 3.4 does)
//this is requried to prevent undef. symbols
using MultiArg<T>::_ignoreable;
using MultiArg<T>::_hasBlanks;
using MultiArg<T>::_extractValue;
using MultiArg<T>::_typeDesc;
using MultiArg<T>::_name;
using MultiArg<T>::_description;
#endif
public: public:
/** /**

View File

@ -43,6 +43,19 @@ namespace TCLAP {
template<class T> template<class T>
class UnlabeledValueArg : public ValueArg<T> class UnlabeledValueArg : public ValueArg<T>
{ {
#ifdef TWO_STAGE_NAME_LOOKUP
//If compiler has two stage name lookup (as gcc >= 3.4 does)
//this is requried to prevent undef. symbols
using ValueArg<T>::_ignoreable;
using ValueArg<T>::_hasBlanks;
using ValueArg<T>::_extractValue;
using ValueArg<T>::_typeDesc;
using ValueArg<T>::_name;
using ValueArg<T>::_description;
using ValueArg<T>::_alreadySet;
#endif
public: public:
/** /**