tags 356113 +patch
thanks

In standard C++, friend functions that are only declared inside a class
can only be found by argument-dependent lookup (and can only be defined
inline, though it's not a syntax error to fail to do so!)

The following patch fixes the compilation errors:

--- src/e_card.h~       2004-02-01 21:13:19.000000000 +0000
+++ src/e_card.h        2006-03-10 02:13:19.909165140 +0000
@@ -32,6 +32,7 @@
 // external
 class CS;
 class COMMON_COMPONENT;
+CARD_LIST::fat_iterator findbranch(CS&,CARD_LIST::fat_iterator);
 /*--------------------------------------------------------------------------*/
 class CARD : public CKT_BASE {
 private:
--- src/e_compon.h~     2004-02-01 21:13:19.000000000 +0000
+++ src/e_compon.h      2006-03-10 02:14:25.126566025 +0000
@@ -43,6 +43,9 @@
 }
 /*--------------------------------------------------------------------------*/
 enum {CC_STATIC=27342}; // mid-sized arbitrary positive int
+class COMMON_COMPONENT;
+void attach_common(COMMON_COMPONENT* c, COMMON_COMPONENT** to);
+void detach_common(COMMON_COMPONENT** from);
 // pass this as an argument to a common constructor to mark it as static,
 // so it won't be deleted
 /*--------------------------------------------------------------------------*/
--- src/l_timer.h~      2004-02-01 21:13:19.000000000 +0000
+++ src/l_timer.h       2006-03-10 02:14:53.878774958 +0000
@@ -25,6 +25,8 @@
 #define U_TIMER_H
 #include "io_.h"
 /*--------------------------------------------------------------------------*/
+class TIMER;
+TIMER  operator-(const TIMER&,const TIMER&);
 class TIMER {
 private:
   enum {_T_NAME_LEN = 8};
--- src/u_sdp.h~        2004-02-01 21:13:19.000000000 +0000
+++ src/u_sdp.h 2006-03-10 02:13:46.221695752 +0000
@@ -29,6 +29,9 @@
 #include "ap.h"
 /*--------------------------------------------------------------------------*/
 class OMSTREAM;
+class SDP;
+bool get(CS& cmd, const std::string& key, SDP* value,
+        AP_MOD mod, double scale);
 /*--------------------------------------------------------------------------*/
 class SDP {
   friend bool get(CS& cmd, const std::string& key, SDP* value,
-- END --

As a temporary alternative, the g++ option "-ffriend-injection" may be
used instead of changing the code, but this option will probably be
removed in some later version.

Ben. 

-- 
Ben Hutchings
Q.  Which is the greater problem in the world today, ignorance or apathy?
A.  I don't know and I couldn't care less.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to