[CLAM] patch for g++3.4 (was : Mysterious compilation errors)

Pau Arumi parumi at iua.upf.es
Thu May 19 09:45:33 PDT 2005


Vegard,
Attached you'll find the patch to make clam  compile with g++3.4  
(thanks David !)
We have tried it in the clam version in cvs but it will hopefully also 
work on clam 0.7.
Note that it needs to be applied being into the CLAM/src directory

Please tell us if it works for you

Pau




Pau Arumi wrote:

> You are right David. At Linux Audio Conference I tried to compile CLAM 
> (in Yann Orlarey laptop) with a gcc 3.4 and we run into these exact 
> problems.
>
> Then we managed to fix it quite easily but, alas, I did not save the 
> changes so we'll have to do it again.  I'll try to get the patch for 
> ready for tomorrow
>
> BTW, we are expecting to release CLAM 0.8 next week.
>
> Best regards
>
> Pau
>
>
> David Garcia Garzon wrote:
>
>> Firstly we are using gcc 3.3.5. Maybe there is some C++ standard 
>> addons on gcc 3.4.3 that could make our namespace usage obsolete. Try 
>> to compile some plain application (build/Examples/Simple/Configurator 
>> is one that is fast to compile and uses this header for sure). If it 
>> fails, then the problem is a new way of dealling namespaces and 
>> template specializations in gcc 3.4 and it would be nice if you can 
>> give us some feedback to solve this.
>>
>> But, if it works it should be due to any inclusions or using 
>> directive you do before CLAM inclusions. Maybe moving CLAM includes 
>> before your project includes and any 'using' directive, and removing 
>> 'using' directives out of any header could help.
>>
>> David.
>>
>> A Dijous 19 Maig 2005 12:16, Vegard Sandvold va escriure:
>>  
>>
>>> Hi,
>>>
>>> this seems to be my week of assorted CLAM issues, this time on Linux.
>>>
>>> I have configure CLAM-0.7.0 on my Fedora Core 3/PlanetCCRMA machine, 
>>> using
>>> a 2.6.10-2.1.ll.rhfc3.ccrma kernel and gcc (GCC) 3.4.3 20050227 (Red 
>>> Hat
>>> 3.4.3-22.fc3) compiler. Specifically, I configured without qwt, 
>>> portmidi
>>> and portaudio.
>>>
>>> When I try to compile my app, I get bucket loads of the following 
>>> kind of
>>> errors:
>>>
>>> /usr/local/src/CLAM-0.7.0/src/Defines/TypeInfo.hxx:61: error: extra
>>> qualification ignored
>>> /usr/local/src/CLAM-0.7.0/src/Defines/TypeInfo.hxx:61: error: explicit
>>> specialization of non-template `CLAM::<anonymous class>'
>>> /usr/local/src/CLAM-0.7.0/src/Defines/TypeInfo.hxx:61: error: abstract
>>> declarator `CLAM::<anonymous class>' used as declaration
>>>
>>> Seems unlikely that there is something fundamentaly wrong with CLAM. 
>>> Can
>>> there be anything wrong with my setup?
>>>
>>> Vegard   
>>>   
>>
>>
>>  
>>
>
>
>
> _______________________________________________
> CLAM mailing list
> CLAM at iua.upf.es
> http://www.iua.upf.es/mtg/clam
>
>

-------------- next part --------------
Index: Base/Factory.hxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Base/Factory.hxx,v
retrieving revision 1.8
diff -u -r1.8 Factory.hxx
--- Base/Factory.hxx	13 Jan 2005 11:30:52 -0000	1.8
+++ Base/Factory.hxx	19 May 2005 16:39:09 -0000
@@ -195,7 +195,8 @@
 
 		bool CommonAddCreator( RegistryKey& creatorId, CreatorMethod creator) {
 			// returns false if the key was repeated.
-			return  _creators.insert( CreatorMap::value_type( creatorId, creator ) ).second;
+			typedef typename CreatorMap::value_type ValueType;
+			return  _creators.insert( ValueType( creatorId, creator ) ).second;
 		}
 
 	};
Index: Defines/TypeInfo.hxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Defines/TypeInfo.hxx,v
retrieving revision 1.4
diff -u -r1.4 TypeInfo.hxx
--- Defines/TypeInfo.hxx	24 Dec 2004 12:52:11 -0000	1.4
+++ Defines/TypeInfo.hxx	19 May 2005 16:39:09 -0000
@@ -47,16 +47,11 @@
 	};
 
 	// Default TypeInfo definition
-	template <typename T> class TypeInfo : public DefaultTypeInfo {
-	/*	public:
-			static const char* name;*/
-	};
-	//template <typename T> const char* TypeInfo<T>::name="UndefinedName";
+	template <typename T> class TypeInfo : public DefaultTypeInfo {};
 
 	// A short for defining a class belonging to a TypeInfo group
-
 #define CLAM_TYPEINFOGROUP(GROUP, TYPE) \
-	template <> class CLAM::TypeInfo< TYPE > : public GROUP  { };
+	template <> class TypeInfo< TYPE > : public GROUP  {};
 
 	CLAM_TYPEINFOGROUP(BasicCTypeInfo, char);
 	CLAM_TYPEINFOGROUP(BasicCTypeInfo, unsigned char);
Index: Defines/TypeInfoStd.hxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Defines/TypeInfoStd.hxx,v
retrieving revision 1.4
diff -u -r1.4 TypeInfoStd.hxx
--- Defines/TypeInfoStd.hxx	24 Dec 2004 12:52:11 -0000	1.4
+++ Defines/TypeInfoStd.hxx	19 May 2005 16:39:09 -0000
@@ -30,6 +30,6 @@
 //CLAM_NATIVE_C_TYPE (std::string);
 namespace CLAM
 {
-	CLAM_TYPEINFOGROUP( CLAM::BasicCTypeInfo, std::string );
+	CLAM_TYPEINFOGROUP( BasicCTypeInfo, std::string );
 }
 #endif//_TYPEINFOSTD_H_
Index: Flow/Controls/ControlMultiplier.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Flow/Controls/ControlMultiplier.cxx,v
retrieving revision 1.5
diff -u -r1.5 ControlMultiplier.cxx
--- Flow/Controls/ControlMultiplier.cxx	24 Dec 2004 12:52:11 -0000	1.5
+++ Flow/Controls/ControlMultiplier.cxx	19 May 2005 16:39:09 -0000
@@ -22,5 +22,5 @@
 #include "ControlMultiplier.hxx"
 using namespace CLAM;
 
-template BinaryControlOp< Multiply<TControlData> >;
+template class BinaryControlOp< Multiply<TControlData> >;
 
Index: Flow/Networks/Network.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Flow/Networks/Network.cxx,v
retrieving revision 1.17
diff -u -r1.17 Network.cxx
--- Flow/Networks/Network.cxx	8 Mar 2005 17:30:36 -0000	1.17
+++ Flow/Networks/Network.cxx	19 May 2005 16:39:09 -0000
@@ -226,14 +226,14 @@
 	{
 		std::string name;
 
-        for ( int i = 0; i<9999999; i++ ) // 9999999 is just an arbitrary large value
-        {
-				std::stringstream<char>	tmp; 
-				tmp << i;
-                name = prefix + "_" + tmp.str(); // pseudo code ofcourse
-                if (!this->HasProcessing( name ) ) return name;
-        }
-        CLAM_ASSERT(false, "All valid id's for given prefix are exhausted");
+		for ( int i = 0; i<9999999; i++ ) // 9999999 is just an arbitrary large value
+		{
+			std::stringstream tmp; 
+			tmp << i;
+			name = prefix + "_" + tmp.str(); // pseudo code ofcourse
+			if (!this->HasProcessing( name ) ) return name;
+		}
+		CLAM_ASSERT(false, "All valid id's for given prefix are exhausted");
 		return "";
 	}
 
Index: Processing/ArithOps/AudioAdder.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Processing/ArithOps/AudioAdder.cxx,v
retrieving revision 1.6
diff -u -r1.6 AudioAdder.cxx
--- Processing/ArithOps/AudioAdder.cxx	24 Dec 2004 12:52:11 -0000	1.6
+++ Processing/ArithOps/AudioAdder.cxx	19 May 2005 16:39:09 -0000
@@ -20,5 +20,7 @@
  */
 
 #include "AudioAdder.hxx"
-using namespace CLAM;
-template BinaryAudioOp< Add<TData> >;
+namespace CLAM
+{
+	template class BinaryAudioOp< Add<TData> >;
+}
Index: Processing/ArithOps/AudioMultiplier.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Processing/ArithOps/AudioMultiplier.cxx,v
retrieving revision 1.5
diff -u -r1.5 AudioMultiplier.cxx
--- Processing/ArithOps/AudioMultiplier.cxx	24 Dec 2004 12:52:11 -0000	1.5
+++ Processing/ArithOps/AudioMultiplier.cxx	19 May 2005 16:39:09 -0000
@@ -20,6 +20,7 @@
  */
 
 #include "AudioMultiplier.hxx"
-using namespace CLAM;
-
-template BinaryAudioOp< Multiply<TData> >;
+namespace CLAM
+{
+	template class BinaryAudioOp< Multiply<TData> >;
+}
Index: Standard/ArrayToBPFCnv.hxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Standard/ArrayToBPFCnv.hxx,v
retrieving revision 1.6
diff -u -r1.6 ArrayToBPFCnv.hxx
--- Standard/ArrayToBPFCnv.hxx	24 Dec 2004 12:52:12 -0000	1.6
+++ Standard/ArrayToBPFCnv.hxx	19 May 2005 16:39:09 -0000
@@ -99,7 +99,7 @@
 	{
 		for(int i=0;i<originalBPF.Size();i++)
 		{
-			 newYArray.AddElem(originalBPF.GetValueFromIndex(i));
+			 newArray.AddElem(originalBPF.GetValueFromIndex(i));
 		}
 	}
 
Index: Standard/BPF.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Standard/BPF.cxx,v
retrieving revision 1.4
diff -u -r1.4 BPF.cxx
--- Standard/BPF.cxx	24 Dec 2004 12:52:12 -0000	1.4
+++ Standard/BPF.cxx	19 May 2005 16:39:09 -0000
@@ -28,7 +28,7 @@
 namespace CLAM
 {
 
-	template BPFTmpl<TData,TData>;
+	template class BPFTmpl<TData,TData>;
 
 }
 
Index: Standard/Complex.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Standard/Complex.cxx,v
retrieving revision 1.4
diff -u -r1.4 Complex.cxx
--- Standard/Complex.cxx	24 Dec 2004 12:52:12 -0000	1.4
+++ Standard/Complex.cxx	19 May 2005 16:39:09 -0000
@@ -28,7 +28,7 @@
 namespace CLAM
 {
 
-	template ComplexTmpl<TData>;
+	template class ComplexTmpl<TData>;
 
 	template 
 	std::istream& operator >> (std::istream &stream, ComplexTmpl<TData> &a);
Index: Standard/Flags.hxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Standard/Flags.hxx,v
retrieving revision 1.8
diff -u -r1.8 Flags.hxx
--- Standard/Flags.hxx	24 Dec 2004 12:52:12 -0000	1.8
+++ Standard/Flags.hxx	19 May 2005 16:39:10 -0000
@@ -301,7 +301,7 @@
 	}
 protected:
 	virtual bool IsSetFlag(unsigned int whichOne) const {
-		return test(whichOne);
+		return std::bitset<N>::test(whichOne);
 	}
 	virtual void SetFlag(unsigned int whichOne, bool value=true) {
 		this->set(whichOne, value);
Index: Standard/Point.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Standard/Point.cxx,v
retrieving revision 1.4
diff -u -r1.4 Point.cxx
--- Standard/Point.cxx	24 Dec 2004 12:52:12 -0000	1.4
+++ Standard/Point.cxx	19 May 2005 16:39:10 -0000
@@ -28,7 +28,7 @@
 namespace CLAM
 {
 
-	template PointTmpl<TData>;
+	template class PointTmpl<TData>;
 
 	template 
 	std::istream& operator >> (std::istream &stream, PointTmpl<TData> &a);
Index: Standard/Polar.cxx
===================================================================
RCS file: /mnt/cvsroot/CLAM/src/Standard/Polar.cxx,v
retrieving revision 1.4
diff -u -r1.4 Polar.cxx
--- Standard/Polar.cxx	24 Dec 2004 12:52:12 -0000	1.4
+++ Standard/Polar.cxx	19 May 2005 16:39:10 -0000
@@ -28,7 +28,7 @@
 namespace CLAM
 {
 
-	template PolarTmpl<TData>;
+	template class PolarTmpl<TData>;
 
 	template 
 	std::istream& operator >> (std::istream &stream, PolarTmpl<TData> &a);


More information about the clam-users mailing list