help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCC 2.9.5 Linker Error and Exception Handling


From: Schein, Robert A (N-Advanced Solutions Inc.)
Subject: GCC 2.9.5 Linker Error and Exception Handling
Date: Wed, 11 Feb 2004 11:47:44 -0700

Hi all,

Using this code as example:

/*----------------------------------------------------------------------------
Class: CPsXmlHlp
Description:
   XML extraction helper.
----------------------------------------------------------------------------*/
class CPsXmlHlp
{
   public :
      CPsXmlHlp();
      virtual ~CPsXmlHlp();

      static U32 GetU32Value(const TiXmlNode* Node)  throw(CPsXmlHlpError)      
                   // Returns the value of an XML element
      {
         if (!Node)
            throw CPsXmlHlpError("GetU32Value: Node is NULL", NULL);
         return atol(Node->ToElement()->Attribute("index"));
      }

      static R64 GetChildR64Value(const TiXmlNode* Node, const char* Name) 
throw(CPsXmlHlpError)   // Returns the value of an XML element
      {
         TiXmlNode* ChildNode = Node->FirstChildElement(Name);
         if (!ChildNode)
            throw CPsXmlHlpError("GetChildR64Value: Item Not Found", Name);
         return atof(ChildNode->ToElement()->Attribute("value"));
      }

      static U32 GetChildU32Value(const TiXmlNode* Node, const char* Name)  
throw(CPsXmlHlpError)  // Returns the value of an XML element
      {
         TiXmlNode* ChildNode = Node->FirstChildElement(Name);
         if (!ChildNode)
            throw CPsXmlHlpError("GetChildU32Value: Item Not Found", Name);
         return atol(Node->FirstChildElement(Name)->Attribute("value"));
      }

   private :
      // Not implemented, to prevent automatic generation and use
      const CPsXmlHlp& operator =(const CPsXmlHlp&);
      CPsXmlHlp(const CPsXmlHlp&);
};


Using the 2.9.5 compiler, I get linker errors 

/appl/sde/home/scheinr/public_html/work/atarps.prj/atarps.exe/atarps_sim.mod/PsUtil.cpp:617:
 undefined reference to `CPsXmlHlp::GetChildU32Value(TiXmlNode const *, char 
const *)'

If I remove exception handling, the application builds successfully.  Is there 
a known bug with exception handling in this compiler version?  Is there a 
compiler switch I'm missing?  What may be a good workaround?

Thanks in advance,

Rob Schein
Advanced Solutions, Inc.
(C) 303.888.1807
(LMCO) 303.971.4575





reply via email to

[Prev in Thread] Current Thread [Next in Thread]